在vscode中创建代码片段
在这里插入图片描述

起一个后缀名为.code-snippets的文件名

我起的名字为vue-html.code-snippets

vue htm 即为代码生成的快捷键

{
		"vue htm": {
			"scope": "html",
			"prefix": "vuehtml",
			"body": [
				"<!DOCTYPE html>",
				"<html lang=\"en\">",
				"",
				"<head>",
				"    <meta charset=\"UTF-8\">",
				"    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
				"    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
				"    <title>Document</title>",
				"</head>",
				"",
				"<body>",
				"    <div id=\"app\">",
				"",
				"    </div>",
				"    <script src=\"vue.min.js\"></script>",
				"    <script>",
				"        new Vue({",
				"            el: '#app',",
				"            data: {",
				"                $1",
				"            }",
				"        })",
				"    </script>",
				"</body>",
				"",
				"</html>",
			],
			"description": "my vue template in html"
		}
	}
Logo

前往低代码交流专区

更多推荐