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”
},
}
原文地址:https://blog.csdn.net/zhangfeng1329972027/article/details/134738546
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_29336.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!