Files
django-vue3-admin/web/src/views/system/menu/components/menuButton/index.vue
2023-04-14 23:04:29 +08:00

27 lines
682 B
Vue

<template>
<fs-crud ref="crudRef" v-bind="crudBinding"> </fs-crud>
</template>
<script lang="ts" setup>
import { ref, defineProps, watch } from 'vue';
import { useFs } from '@fast-crud/fast-crud';
import { createCrudOptions } from './crud';
// 当前选择的菜单信息
let selectOptions: any = ref({ name: null });
const props = defineProps<{
selectMenu: object;
}>();
watch(props.selectMenu, (val: any) => {
if (!val.is_catalog) {
selectOptions.value = val;
doRefresh();
}
});
const { crudRef, crudBinding, crudExpose, context } = useFs({ createCrudOptions, context: { selectOptions } });
const { doRefresh } = crudExpose;
defineExpose({ selectOptions });
</script>