button java htm body log javascrip doc text
- <!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>
内联处理器里的方法
来源: http://www.bubuko.com/infodetail-2312590.html