赞
踩
<!DOCTYPE html> <html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <div id="app"> <img src="img/1.jpg" v-show="isShow,age>18" > <input type="button" value="切换显示状态" @click="changeIsshow"> </div> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> <script> //创建vue实例 var app = new Vue({ el:"#app", data:{ isShow:false, age:19 }, methods:{ changeIsshow:function () { this.isShow = !this.isShow; } }, }) </script> </body> </html>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。