重新学习Vue_01

1 // 阻止启动生产消息  没有多大用
2 Vue.config.productionTip = true;
1 new Vue({
2   render: h => h(App),
3 }).$mount('#app');
 1     es5  上面函数的几种不同的写法
 2    render: function(createElement){
 3         return createElement(App)
 4    }
 5    es6
 6    render(createElement){
 7       return createElement(App)
 8    }
 9 
10    render(h){
11       return h(App)
12    }
13 
14    render: h => h(App);
1 双向绑定可以使用表达式
2 {{intro.toUpperCase()}}
1   模板字符串
2 <p><button @click="study('小撩')">学习Vue</button></p>
3  study(name){
4      alert(`${name},祝你学有所成!`);
5 }

猜你喜欢

转载自www.cnblogs.com/zhangzhengyang/p/11409665.html