vscode配置代码片段

1.ctrl + shift + p 然后选择 Snippets:Configure User Snippets (配置用户代码片段)

2.选择vue或者vue.json

3.下面为json内容

{

"vue-template": {

"prefix": "modal-table",

"body": [

"",

" <a-modal v-model:visible="visible" width="1000px" title="" :maskClosable="false" @ok="onOk">",

" <a-table bordered :columns="columns" :pagination="false" :data-source="list"> ",

" ",

"",

"",

"<script setup lang="tsx">",

"import { message } from 'ant-design-vue'",

"import request from '@/utils/request'",

"const emit = defineEmits(['sure'])",

"const visible = ref(false)",

"const list: any = ref([])",

"const columns = [",

" {",

" title: '',",

" dataIndex: 'name',",

" align: 'center',",

" customRender: ({ record }: { record: any }) => {",

" return (",

" // prettier-ignore",

"
",
" )",
" }",
" },",
" {",
" title: '',",
" dataIndex: 'age',",
" align: 'center'",
" }",
"]",
"function onOk() {",
" emit('sure')",
" visible.value = false",
"}",
"function showModal() {",
" visible.value = true",
"}",
"defineExpose({ showModal })",
""
],
"description": "vue-template"
},
"vue-template": {
"prefix": "modal",
"body": [
"",
" <a-modal v-model:visible="visible" width="1000px" title="" :maskClosable="false" @ok="onOk">",
"",
" ",
"",
"",
"<script setup lang="tsx">",
"import { message } from 'ant-design-vue'",
"import request from '@/utils/request'",
"const emit = defineEmits(['sure'])",
"const visible = ref(false)",
"function onOk() {",
" emit('sure')",
" visible.value = false",
"}",
"function showModal() {",
" visible.value = true",
"}",
"defineExpose({ showModal })",
""
],
"description": "vue-template"
},
}

相关推荐
Heidi__2 小时前
Vue 3 的响应式原理
前端·javascript·vue.js
栈溢出了3 小时前
pycharm 有智能提示,但是没法自动导包,也就是alt+enter无效果
ide·python·pycharm
Monly214 小时前
Vue:Table在点击删除的时候阻止行点击事件
前端·javascript·vue.js
╰つ゛木槿5 小时前
使用VSCode编写C#程序
ide·vscode·c#
工业互联网专业6 小时前
基于springboot+vue的二手车交易系统
java·vue.js·spring boot·毕业设计·源码·课程设计·二手车交易系统
前端小趴菜056 小时前
记录 vue-router访问 / 路径直接重定向到有权限的第一个菜单
前端·javascript·vue.js
Eva2156657 小时前
Flask+Vue构建图书管理系统及Echarts组件的使用
vue.js·flask·echarts
GuokLiu8 小时前
250405-VSCode编辑launch.json实现Debug调试Open-WebUI
vscode·debug·open-webui
艾克马斯奎普特10 小时前
Vue.js 3 渐进式实现之响应式系统——第六节:嵌套的 effect 与 effect 栈
前端·vue.js
花花鱼10 小时前
vscode中的【粘滞滚动】的基本概念和作用,关闭了以后如何开启
ide·vscode·编辑器