对于vsc中的vue命令 vue.json

打开vsc 然后在左下角有一个设置

2.点击用户代码片段

3.输入 vue.json回车

将此代码粘贴 (我的不一定都适合)

{

"vue2 template": {

"prefix": "v2",

"body": [

"<template>",

" <div>",

" $1",

" </div>",

"</template>",

"",

"<script>",

"export default {",

" data() {",

" return {",

" $2",

" };",

" },",

" methods: {},",

" computed: {},",

" components: {},",

" filters: {},",

" watch: {},",

" created() {},",

" mounted() {},",

"};",

"</script>",

"",

"<style lang=\"scss\" scoped>",

" $3",

"</style>"

],

"description": "vue2"

},

"vue3": {

"prefix": "v3",

"body": [

"<template>",

" $1",

"</template>",

"",

"<script setup>",

"import { ref, reactive } from \"vue\";",

"",

"</script>",

"",

"<style lang=\"${2:scss}\" ${3:scoped}></style>"

],

"description": "vue3"

},

"vue3 ts": {

"prefix": "v3-ts",

"body": [

"<template>",

" $1",

"</template>",

"",

"<script lang=\"ts\" setup>",

"import { ref, reactive } from \"vue\";",

"",

"</script>",

"",

"<style lang=\"${2:scss}\" ${3:scoped}></style>"

],

"description": "vue3 ts"

},

}

相关推荐
燃先生._.38 分钟前
Day-03 Vue(生命周期、生命周期钩子八个函数、工程化开发和脚手架、组件化开发、根组件、局部注册和全局注册的步骤)
前端·javascript·vue.js
高山我梦口香糖2 小时前
[react]searchParams转普通对象
开发语言·前端·javascript
m0_748235242 小时前
前端实现获取后端返回的文件流并下载
前端·状态模式
m0_748240253 小时前
前端如何检测用户登录状态是否过期
前端
black^sugar3 小时前
纯前端实现更新检测
开发语言·前端·javascript
寻找沙漠的人3 小时前
前端知识补充—CSS
前端·css
GISer_Jing3 小时前
2025前端面试热门题目——计算机网络篇
前端·计算机网络·面试
m0_748245523 小时前
吉利前端、AI面试
前端·面试·职场和发展
理想不理想v4 小时前
webpack最基础的配置
前端·webpack·node.js