给我用vue + elementUi一个闭着眼睛的图标
<template>
<div>
<el-icon :class="{ 'is-rotate': isRotate }" name="el-icon-close"></el-icon>
</div>
</template>
<script>
export default {
data() {
return {
isRotate: true
}
},
mounted() {
setTimeout(() => {
this.isRotate = false
}, 1000)
}
}
</script>
<style>
.is-rotate {
animation: rotate 1s linear infinite;
}
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
</style>
原文地址: https://www.cveoy.top/t/topic/efxT 著作权归作者所有。请勿转载和采集!