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

},

}

相关推荐
范文杰3 小时前
AI 时代如何更高效开发前端组件?21st.dev 给了一种答案
前端·ai编程
拉不动的猪3 小时前
刷刷题50(常见的js数据通信与渲染问题)
前端·javascript·面试
拉不动的猪3 小时前
JS多线程Webworks中的几种实战场景演示
前端·javascript·面试
FreeCultureBoy3 小时前
macOS 命令行 原生挂载 webdav 方法
前端
uhakadotcom4 小时前
Astro 框架:快速构建内容驱动型网站的利器
前端·javascript·面试
uhakadotcom4 小时前
了解Nest.js和Next.js:如何选择合适的框架
前端·javascript·面试
uhakadotcom4 小时前
React与Next.js:基础知识及应用场景
前端·面试·github
uhakadotcom4 小时前
Remix 框架:性能与易用性的完美结合
前端·javascript·面试
uhakadotcom4 小时前
Node.js 包管理器:npm vs pnpm
前端·javascript·面试
LaoZhangAI5 小时前
2025最全GPT-4o图像生成API指南:官方接口配置+15个实用提示词【保姆级教程】
前端