900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > html5代码自动生成 vs code中设置html5 快速生成模板

html5代码自动生成 vs code中设置html5 快速生成模板

时间:2020-07-13 04:14:03

相关推荐

html5代码自动生成 vs code中设置html5 快速生成模板

按英文的!和h:5都可以快速生成html模板,但是找了半天都找不到如何修改模板设置。只好自己从snippets里重新编写了一个html5的模板,以免自己以后忘了。

首先打开 snippets

然后输入以下代码段:

{

// Place your snippets for html here. Each snippet is defined under a snippet name and has a prefix, body and

// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:

// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the

// same ids are connected.

// Example:

// "Print to console": {

// "prefix": "log",

// "body": [

// "console.log('$1');",

// "$2"

// ],

// "description": "Log output to console"

// }

"Html5-Vue": {

"prefix": "vh",

"body": [

"",

"\n",

"

",

"\t",

"\t",

"\t",

"\t

Document",

"\t",

"\n",

"

",

"\t

$1\n",

"\t

"\t\tvar vm = new Vue({",

"\t\t\tel: '#app',",

"\t\t\tdata: {},",

"\t\t\tmethods: {}",

"\t\t});",

"\t",

"\n",

""

],

"description": "快速创建在html5编写的vue模板"

}

}

这里的 “prefix”: “vh”,指的是你自定义的快捷代码,这里我输入h就会出现快速生成代码提示,也可以自定义其他字段。

效果如下:

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。