内联处理器里的方法

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <button v-on:click="fun('value11111')">aaa</button>
        <button v-on:click="fun('value22222')">bbb</button>
    </div>
</body>
<script type="text/javascript" src="js/vue.js"></script>
<script type="text/javascript">
    new Vue({
        el:"#app",
        methods:{
            fun:function(a){
                alert(a)
            }
        }
    })
</script>

</html>

 

posted @ 2017-09-17 12:53  Jinsuo  阅读(321)  评论(0编辑  收藏  举报