VSCode-快速⽣成vue 模版
1、安装⼀个插件,识别vue ⽂件
2
、新建代码⽚段
3、在vue.json ⾥写下⾃⼰想要⽣成的vue 模版
4、粘贴以上代码复制到vue.json ⾥效果如下
管理-> ⾸选项 -> ⽤户代码⽚段 -> (新建代码⽚段取名vue.json )
vuejson转对象新建代码⽚段这块可以直接往下就能到vscode 上带的vue.json
{
// Place your snippets for vue 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": "vue",
"body": [
//"<!-- $1 -->",
"<template>",
" <div>",
" </div>",
"</template>",
"",
"<script>",
"export default {",
" data() {",
" return {",
" ",
" }",
" },",
" //⽣命周期 - 创建完成(访问当前this 实例)",
" created() {",
" ",
" },",
" //⽣命周期 - 挂载完成(访问DOM 元素)",
" mounted() {",
" ",
" }",
"}",
"</script>",
"<style scoped>",
"/* @import url(); 引⼊css 类 */",
"$4",
"</style>"
]
,
"description": "Log output to console"
}
}
此处说明⼀下:"prefix": "vue", 就是快捷键,(vue 名称可随意修改)
新建vue ⽂件,输⼊vue 按键盘的tab 件⽣成vue 模版
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论