摘要: v-if,v-else-if,v-else 控制元素是否渲染,不满足条件的时候不会有相应元素。 <div v-if="type 'A'"> A </div> <div v-else-if="type 'B'"> B </div> <div v-else-if="type 'C'"> C </div> 阅读全文
posted @ 2023-07-12 14:35 luytest 阅读(18) 评论(0) 推荐(0) 编辑
摘要: Vue3关于样式的处理跟Vue2是一样的,常用的有以下几种。 1.绑定属性 html部分: <div :class="{ active: isActive }"></div> js部分: data() { return { isActive: true } } 当 isActive 值为true时, 阅读全文
posted @ 2023-07-12 11:32 luytest 阅读(16) 评论(0) 推荐(0) 编辑