wip: crud table

This commit is contained in:
张传龙
2022-08-31 10:16:38 +08:00
parent af983d16b9
commit 9ea8ffd7fd
7 changed files with 168 additions and 18 deletions

View File

@@ -0,0 +1,44 @@
<template>
<n-modal v-model:show="show" :style="{ width }" preset="card" :title="title" size="huge" :bordered="false">
<slot />
<template v-if="showFooter" #footer>
<footer flex justify-end>
<slot name="footer">
<n-button @click="show = false">取消</n-button>
<n-button ml-20 type="primary" @click="emit('onSave')">保存</n-button>
</slot>
</footer>
</template>
</n-modal>
</template>
<script setup>
const props = defineProps({
width: {
type: String,
default: '600px',
},
title: {
type: String,
default: '',
},
showFooter: {
type: Boolean,
default: true,
},
visible: {
type: Boolean,
required: true,
},
})
const emit = defineEmits(['update:visible', 'onSave'])
const show = computed({
get() {
return props.visible
},
set(v) {
emit('update:visible', v)
},
})
</script>

View File

@@ -0,0 +1,16 @@
<template>
<QueryBar v-if="$slots.queryBar" mb-30>
<slot name="queryBar" />
</QueryBar>
<slot />
</template>
<script setup>
const loading = ref(false)
const tableData = ref([])
const showModal = ref(true)
const segmented = {
content: 'soft',
footer: 'soft',
}
</script>