大佬教程收集整理的这篇文章主要介绍了VSCode 在HTML中自定义vue模板的实现,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
位置:在Vscode中找到 设置 -> 用户代码片段,在输入框内输入html,并点击第一个html.json。
复制以下代码:
{ // 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" // } "Print to console": { "prefix": "vue", // 对应的是使用这个模板的快捷键 "body": [ "<div id="app">", "t{{messagE}}", "</div>n", "<script src="../js/vue.js"></script>", "<script>", " //创建Vue实例,得到 ViewModel", " const app = new Vue({", "tel: '#app',", "tdata: {", "ttmessage: '${1:Hello}',", "t},", "tmethods: {", "tt", "t}", " });", "</script>", ], "description": "a vue template" // 模板的描述 } }
转义字符解释:
t " n都是转义字符,而空格就是单纯的空格,输入时可以输入空格t 的意思是 横向跳到下一制表符位置 等于 Tab键" 的意思是 双引号n 的意思是回车换行
$1代表着光标,它的位置即光标的默认位置,可以有多个光标:$2,$3,$4等
以上是大佬教程为你收集整理的VSCode 在HTML中自定义vue模板的实现全部内容,希望文章能够帮你解决VSCode 在HTML中自定义vue模板的实现所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。