900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > 2 snippets vue 修改配置_VSCode 自定义Vue snippets 快速生成Vue模板

2 snippets vue 修改配置_VSCode 自定义Vue snippets 快速生成Vue模板

时间:2019-11-06 07:10:27

相关推荐

2 snippets vue 修改配置_VSCode 自定义Vue snippets  快速生成Vue模板

命令行

Ctrl+Shift+P

# 选择 Configure User Snippets

# 选择 Vue.json

原始的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": "log",

// "body": [

// "console.log(‘$1‘);",

// "$2"

// ],

// "description": "Log output to console"

// }

}

修改后的Vue.json

prefix: vue

body修改为希望的内容

{

// Example:

"Print to console": {

"prefix": "vue",

"body": [

"",

"

$0",

"",

"",

"

"export default {",

" components: {},",

" props: {},",

" data() {",

" return {",

" };",

" },",

" watch: {},",

" computed: {},",

" methods: {},",

" created() {},",

" mounted() {}",

"};",

"",

"

".wrapper{}",

""

],

"description": "A vue file template"

}

}

Try

新建一个.vue文件,然后输入vue,然后回车

export default {

components: {},

props: {},

data() {

return {

};

},

watch: {},

computed: {},

methods: {},

created() { },

mounted() { }

};

.wrapper {

}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。