VUE第一次学习

129 阅读1分钟

要是vue create 很慢,可以尝试yarn config set registry registry.npm.taobao.org

VUE两个版本:

VUE完整版:vue.js(可以直接从html获得视图)

完整版中含有编译器compiler,但是代码体积占比更大

视图写在html或者写在template选项里

用法:

new Vue({
template:`<div>{{n}}</div>`
})

VUE非完整版:vue.runtime.js

写在rander函数用h创建标签

new Vue({
return (h){
return h('div',this.n)
}
})

如何使用codeesandbox.io写代码

1.进入****codeesandbox.io,不要登录

2.点击 Create sandbox,创建沙盒

3.选择创建VUE即可