{
// 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"
// }
"Print vue2 component template": {
"prefix": "pzyvue2",
"body": [
"<template>",
" <div>$1 $TM_FILENAME_BASE</div>"
"</template>",
"",
"<script>",
"export default {",
" name: '$TM_FILENAME_BASE',",
" props: {},",
" data() {",
" return {}",
" },",
" computed: {},",
" created() {",
" console.log('组件 $TM_FILENAME_BASE 创建!')",
" },",
" updated() {",
" console.log('组件 $TM_FILENAME_BASE 更新!')",
" },",
" methods: {},",
"}",
"</script>"
"",
"<style lang=\"scss\" scoped></style>"
],
"description": "输出vue2组件模板"
},
"Print vue3 component template": {
"prefix": "pzyvue3",
"body": [
"<template>",
" <div>$1 $TM_FILENAME_BASE</div>"
"</template>",
"",
"<script lang=\"ts\">",
"import { defineComponent, toRefs, ref, reactive } from 'vue'",
"export default defineComponent({",
" name: '$TM_FILENAME_BASE',",
" props: {},",
" emits: {},",
" setup(props, { attrs, slots, emit }) {",
" const { title } = toRefs(props)",
" const readersNumber = ref<Number>(0)",
" const book = reactive({ title: 'Vue 3 Guide' })",
" return {}",
" },",
" data() {",
" return {}",
" },",
" computed: {},",
" created() {",
" console.log('组件 $TM_FILENAME_BASE 创建!')",
" },",
" updated() {",
" console.log('组件 $TM_FILENAME_BASE 更新!')",
" },",
" methods: {},",
"})",
"</script>"
"",
"<style lang=\"scss\" scoped></style>"
],
"description": "输出vue3组件模板"
}
}
vscode用户片段
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 1、打开vscode, 文件-首选项-用户代码片段,选择代码片段文件或创建代码片段,选择或新建vue.json 2...
- 写vue组件碰到的第一个问题,就是每次都要写template,script,style标签,这种重复性高的工作,我...
- 今天青石的票圈出镜率最高的,莫过于张艺谋的新片终于定档了。 一张满溢着水墨风的海报一次次的出现在票圈里,也就是老谋...