2018-01-29 07:47:26 +00:00
|
|
|
const StillImage = {
|
|
|
|
props: [
|
|
|
|
'src',
|
|
|
|
'referrerpolicy',
|
|
|
|
'mimetype'
|
|
|
|
],
|
|
|
|
computed: {
|
2018-02-03 17:32:13 +00:00
|
|
|
animated () {
|
|
|
|
return this.mimetype === 'image/gif' || this.src.endsWith('.gif')
|
2018-01-29 07:47:26 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
2018-02-03 16:55:45 +00:00
|
|
|
onLoad () {
|
2018-01-29 07:47:26 +00:00
|
|
|
const canvas = this.$refs.canvas
|
|
|
|
if (!canvas) return
|
2018-02-03 16:55:45 +00:00
|
|
|
canvas.getContext('2d').drawImage(this.$refs.src, 1, 1, canvas.width, canvas.height)
|
2018-01-29 07:47:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default StillImage
|