<tempalte>
<view>
<image :src="gifUrl" class="img-gif"></image>
<button @click="resetGif">重新播放</button>
</view>
</template>
<script>
import permit_app from '@/config/permit_app.js'
export default {
data() {
return {
gifUrl: '../static/test.gif'
}
},
methods: {
resetGif() {
// 通过拼接时间戳实现重新播放效果
this.gifUrl = `../static/test.gif?${new Date().getTime()}`
},
}
}
</script>
<style lang="scss" scoped>
.img-gif {
width: 400rpx;
height: 400rpx;
}
</style>