39 lines
1011 B
Vue
Raw Normal View History

2022-12-05 23:01:12 +08:00
<template>
<el-table :data="data" class="mt-3" v-loading="loading">
<el-table-column prop="name" label="字段名称" />
<el-table-column prop="type" label="类型" />
<el-table-column prop="nullable" label="nullable">
<template #default="scope">
<el-tag v-if="scope.row.nullable"></el-tag>
<el-tag type="danger" v-else></el-tag>
</template>
</el-table-column>
<el-table-column prop="default" label="默认值">
<template #default="scope"> </template>
</el-table-column>
<el-table-column prop="comment" label="注释" />
</el-table>
</template>
<script lang="ts" setup>
import { useShow } from '/admin/composables/curd/useShow'
import { onMounted } from 'vue'
import { ref } from 'vue'
const props = defineProps({
id: {
type: Number,
required: true,
},
})
const data = ref<Array<object>>()
onMounted(() => {
useShow('schema', props.id).then(r => {
data.value = r.data.columns
})
})
</script>
<style scoped></style>