<!DOCTYPE html> <html> <script src="https://unpkg.com/vue/dist/vue.min.js"></script> <head> <meta charset="UTF-8"> <title>Insert title here</title> </head> <body> <div id="app"> <p v-if="show">这是一段文本</p> <button v-on:click="handleClose">点击隐藏</button> <a v-bind:href="url">GEBIDASHABI</a> <img v-bind:src="img"></img> </div> </body> <script> var app = new Vue({ el: '#app', data:{ show:true, url:'https://www.baidu.com', img:'https://www.google.com.hk/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png' }, methods:{ handleClose:function(){ this.show = false; } } }) </script> </html>