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

},

}

相关推荐
2分钟速写快排5 小时前
孔乙己的茴字有多少种写法?|AI 对话实时通信的三种实现
前端·javascript·github
Penge6667 小时前
JavaScript:BOM 详解
前端
梯度下降者7 小时前
Nuxt框架
vue.js·服务端渲染·全栈开发·混合渲染·nuxt框架
Penge6667 小时前
Vite vs Webpack:前端构建工具原理与实战
前端
Penge6667 小时前
前端包管理工具:npm、Yarn、pnpm 快速入门
前端
Penge6668 小时前
Sass 了解
前端
Penge6668 小时前
Webpack 打包从 0 到 1 实战笔记
前端
Penge6668 小时前
Webpack 入门:是什么、为什么需要、怎么使用?
前端
Penge6668 小时前
Ant Design(Antd)了解
前端
wangruofeng9 小时前
同一行代码,百种渲染:Asuka、React Native 与 Flutter 跨平台渲染机制深度拆解
前端·github