vue是什么?
一套用于构建用户界面的渐进式框架
概括

创建一个html页面
1. 在script中引入vue的文件,类似于操作JQuery
2. 新建一个div标签,用于显示vue(在vue中的el定义作用范围)

显示如下:

抽取公共代码用于其他地方使用
由于这段vue的代码格式固定,所以我们可以考虑将它抽取出来作为公共代码使用
这也就是前端所说的 创建代码片段
Code -> 首选项 -> 用户代码片段 -> 新建全局代码片段/或文件夹代码片段:vue-html.code-snippets
注意:在制作代码片段的时候,字符串中如果包含文件中复制过来的Tab键的空格,要换成空格键的空格

在片段中写入下列代码

片段的使用
在输入vuehtml的时候就会出来之前写的模版片段,点击就能生成模版


网友评论