标签:vue image script doc vuejs span round bind app
参数绑定HTML
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Vue 测试实例 - 菜鸟教程(runoob.com)</title> <script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script> </head> <body> <div id="app"> <pre><a v-bind:href="url">青青子衿</a></pre> </div> <script> new Vue({ el: ‘#app‘, data: { url: ‘http://www.boonya.com‘ } }) </script> </body> </html>
参数绑定效果:
事件绑定HTML
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Vue 测试实例 - 菜鸟教程(runoob.com)</title> <script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script> </head> <body> <div id="app"> <a v-on:click="doSomething">doSomething</a> </div> <script> new Vue({ el: ‘#app‘, data: { doSomething:function(){ alert("Do something"); } } }) </script> </body> </html>
事件绑定效果:
VueJS参数绑定:v-bind:href,v-on:event
标签:vue image script doc vuejs span round bind app
原文地址:http://www.cnblogs.com/boonya/p/7090237.html