这个功能是在用于用户想界面主题颜色 ,用户可以手动改
<template>
<div class="hello">
<div class="myDiv" :class="myColor">
div3
<input type="text" v-model="myColor">
</div>
<button @click="addClass">改变样式</button>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
},
data(){
return{
myColor: 'he300'
}
},
computed:{
},
watch:{
},
methods:{
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.myDiv{
width: 200px;
height: 200px;
background: #42b983;
margin-top: 20px;
}
.he300{
height: 300px;
}
.red{
color: red;
}
.green{
color: green;
}
</style>