对于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"

},

}

相关推荐
纯爱掌门人42 分钟前
干了这么多年前端,聊聊 2026 年我们到底还值不值钱
前端·程序员
houhou1 小时前
Monaco Editor 集成指南:从配置到优化
前端
hunterandroid1 小时前
[Android 从零到一] Custom View 自定义绘制:从 onDraw 到完整交互
前端
李明卫杭州1 小时前
Vue3 v-memo 指令详解:让你的列表渲染性能翻倍 🚀
前端
梨子同志1 小时前
Monorepo
前端
lihaozecq1 小时前
继 Web Coding Agent 后,我做了一个本地优先的桌面 AI Agent
前端·agent
用户298698530141 小时前
在 React 中使用 JavaScript 将 Excel 转换为 SVG
前端·javascript·react.js
CodingSpace2 小时前
ESLint
前端
Csvn2 小时前
异步错误捕获的六大陷阱:await 裹着 try-catch 就一定稳了吗?
前端
用户059540174462 小时前
向量库静默丢数据踩坑实录:Playwright 端到端测试让我排查了72小时
前端·css