1.ctrl + shift + p 然后选择 Snippets:Configure User Snippets配置用户代码片段
2.选择vue或者vue.json
3.下面为json内容
{
vuetemplate”: {
prefix”: “modaltable”,
body”: [
“”,
” <amodal vmodel:visible=“visiblewidth=“1000pxtitle=“” :maskClosable=“false” @ok=“onOk”>“,
” <atable bordered :columns=“columns” :pagination=“false” :datasource=“list”> ”,
” “,
“”,
“”,
“<script setup lang=“tsx”>”,
import { message } fromantdesignvue’”,
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 (“,
” // prettierignore”,

“,

” )”,

” }“,

” },”,

” {“,

title: ‘’,”,

” dataIndex: ‘age’,“,

align: ‘center’”,

” }“,

“]”,

function onOk() {”,

emit(‘sure’)”,

visible.value = false”,

“}”,

function showModal() {”,

visible.value = true“,

“}”,

defineExpose({ showModal })”,

“”

],

description”: “vuetemplate

},

vuetemplate”: {

prefix”: “modal”,

body”: [

“”,

” <a-modal v-model:visible=“visiblewidth=“1000pxtitle=“” :maskClosable=“false” @ok=“onOk”>“,

“”,

” ”,

“”,

“”,

“<script setup lang=“tsx”>”,

import { message } from ‘antdesign-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”: “vuetemplate

},

}

原文地址:https://blog.csdn.net/zhangfeng1329972027/article/details/134738546

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_29336.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注