1. 开发需要配置的代码
"create vue app": {
"prefix": "vueapp",
"body": [
"<html lang=\"en\">",
"<head>",
" <meta charset=\"UTF-8\">",
" <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">",
" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
" <title>Document</title>",
"</head>",
"<body>",
"",
" <div id=\"app\">",
" </div>",
" ",
" <script src=\"../lib/vue.js\"></script>",
" <script>",
" // 1. create an app",
" const app = Vue.createApp({",
" // data: option api",
" data: function() {",
" return {",
" message: \"Hello Vue\"",
" }",
" }",
" })",
"",
" // 2. mount app",
" app.mount(\"#app\")",
" </script>",
"</body>",
"</html>"
],
"description": "create vue app"
}
2. 使用片段生成器生成代码snippet
https://snippet-generator.app/
2.1 输入描述/关键字/代码块
2.2. 赋值生成的json
"create vue app": {
"prefix": "vueapp",
"body": [
"<html lang=\"en\">",
"<head>",
" <meta charset=\"UTF-8\">",
" <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">",
" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
" <title>Document</title>",
"</head>",
"<body>",
"",
" <div id=\"app\">",
" </div>",
" ",
" <script src=\"../lib/vue.js\"></script>",
" <script>",
" // 1. create an app",
" const app = Vue.createApp({",
" // data: option api",
" data: function() {",
" return {",
" message: \"Hello Vue\"",
" }",
" }",
" })",
"",
" // 2. mount app",
" app.mount(\"#app\")",
" </script>",
"</body>",
"</html>"
],
"description": "create vue app"
}