<template>
<div>
<el-button type="primary" @click="test">测试按钮</el-button>
<div :style="classStyle"></div>
</div>
</template>
<script>
export default {
data() {
return {
classStyle: 'width: 2vh;height: 2vh;background-color: green;border-radius: 50%;',
keyShow: true,
}
},
methods: {
test() {
this.keyShow = !this.keyShow
if (this.keyShow == true) {
this.classStyle = 'width: 2vh;height: 2vh;background-color: green;border-radius: 50%;'
} else {
this.classStyle = 'width: 2vh;height: 2vh;background-color: red;border-radius: 50%;'
}
},
},
}
</script>
<style lang="scss" scoped></style>
vue出现小圆点
最新推荐文章于 2023-03-20 14:40:07 发布