自定义代码片段
- vscode自带的生成的html片段命令是 !+ tab / mac上直接回车
- 首选项--用户代码片段输入html
- 在html.json输入以下的片段代码
- 建议使用是!h+tab
-
2tab切换下一个$
- 删除方式 文件标签右键 在finder中显示(mac)
{
"html:5": {
"prefix": "!h",
"body": [
"<!DOCTYPE html>",
"<html>",
"<head>",
"\t<meta charset=\"UTF-8\">",
"\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0,minimum-scale=1,maximum-scale=1,user-scalable=no\">",
"\t<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
"\t<title></title>",
"</head>",
"\t<style type=\"text/css\">",
"\t</style>",
"<body>",
"</body>",
"\t<script type=\"text/javascript\">",
"\t</script>",
"</html>",
],
"description": "HTML5"
}
}
{
"Print to console": {
"prefix": "vue",
"body": [
"<template>",
" <div class=\"$2\"></div>",
"</template>",
"",
"<script>",
"export default {",
" data() {",
" return {",
"",
" };",
" },",
" computed: {},",
" watch: {},",
" methods: {",
"",
" },",
" created() {",
"",
" },",
" mounted() {",
"",
" },",
" components: {},",
"}",
"</script>",
"",
"<style lang=\"scss\" scoped>",
"</style>"
],
"description": "Log output to console"
}
}