vue 点击弹出当前的text

来源:互联网 发布:淘宝自动核对地址 编辑:程序博客网 时间:2024/06/11 02:26
  <div id="app">
      <button class='btn' @click='btnHandler($event)'>默认按钮</button>
   </div>
   <script type="text/javascript">
        new Vue({
           el:"#app",
             methods:{
             btnHandler:function(event){
              alert(event.target.innerText)
             }
           }
        })


   </script>