vscode怎么生成模板

vscode怎么生成模板

vscode怎么生成模板?vs code中设置html5 快速生成模板

相关文章教程推荐:vscode教程

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

首先打开 snippets

b5d6ef99008a52991b39e97398e653b.png

然后输入以下代码段:

{    // 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",            "tDocument",            "t",            "n",            "",            "t
$1
n", "t", "ttvar vm = new Vue({", "tttel: '#app',", "tttdata: {},", "tttmethods: {}", "tt});", "t", "n", "" ], "description": "快速创建在html5编写的vue模板" }}

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

53d8ac3cf191fc0d6713f8e9939f4a5.png

效果如下:

6cd725095329e1b4fda37a28233706c.png

以上就是vscode怎么生成模板的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/71451.html

赞 (0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
顾客有需求变更怎么回答
上一篇 2025年11月13日 11:13:02
项目需求变更范本怎么写
下一篇 2025年11月13日 11:13:52

相关推荐

发表回复

登录后才能评论
关注微信