点击开关按钮,实现div显示隐藏


<a-switch ></a-switch>  //开关按钮
 
html:
<a-switch  @change="onChange"/>  //点击按钮  onChange 变成false

<div  v-show="isShow" >123</div>     //隐藏 123
 
methods:
   onChange(checked) {
      console.log(checked);  //checked =false
      this.isShow = checked;     // isShow = false 
    },

发布了63 篇原创文章 · 获赞 5 · 访问量 826

猜你喜欢

转载自blog.csdn.net/wuj1935/article/details/102982299