mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-25 02:58:43 +08:00
Merge pull request #3078 from wangjue666/chore-type
Chore: 优化了ApiTree绑定属性TS类型问题,删除了无用的插槽和引用
This commit is contained in:
commit
edffc12bb7
@ -3,9 +3,6 @@
|
|||||||
<template #[item]="data" v-for="item in Object.keys($slots)">
|
<template #[item]="data" v-for="item in Object.keys($slots)">
|
||||||
<slot :name="item" v-bind="data || {}"></slot>
|
<slot :name="item" v-bind="data || {}"></slot>
|
||||||
</template>
|
</template>
|
||||||
<template #suffixIcon v-if="loading">
|
|
||||||
<LoadingOutlined spin />
|
|
||||||
</template>
|
|
||||||
</a-tree>
|
</a-tree>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -16,11 +13,11 @@
|
|||||||
import { isArray, isFunction } from '/@/utils/is';
|
import { isArray, isFunction } from '/@/utils/is';
|
||||||
import { get } from 'lodash-es';
|
import { get } from 'lodash-es';
|
||||||
import { propTypes } from '/@/utils/propTypes';
|
import { propTypes } from '/@/utils/propTypes';
|
||||||
import { LoadingOutlined } from '@ant-design/icons-vue';
|
import { DataNode } from 'ant-design-vue/es/tree';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ApiTree',
|
name: 'ApiTree',
|
||||||
components: { ATree: Tree, LoadingOutlined },
|
components: { ATree: Tree },
|
||||||
props: {
|
props: {
|
||||||
api: { type: Function as PropType<(arg?: Recordable<any>) => Promise<Recordable<any>>> },
|
api: { type: Function as PropType<(arg?: Recordable<any>) => Promise<Recordable<any>>> },
|
||||||
params: { type: Object },
|
params: { type: Object },
|
||||||
@ -30,7 +27,7 @@
|
|||||||
},
|
},
|
||||||
emits: ['options-change', 'change'],
|
emits: ['options-change', 'change'],
|
||||||
setup(props, { attrs, emit }) {
|
setup(props, { attrs, emit }) {
|
||||||
const treeData = ref<Recordable<any>[]>([]);
|
const treeData = ref<DataNode[]>([]);
|
||||||
const isFirstLoaded = ref<Boolean>(false);
|
const isFirstLoaded = ref<Boolean>(false);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const getAttrs = computed(() => {
|
const getAttrs = computed(() => {
|
||||||
|
@ -11,16 +11,7 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { type Recordable } from '@vben/types';
|
import { type Recordable } from '@vben/types';
|
||||||
import {
|
import { type PropType, computed, defineComponent, watch, ref, onMounted, unref } from 'vue';
|
||||||
type PropType,
|
|
||||||
computed,
|
|
||||||
defineComponent,
|
|
||||||
watchEffect,
|
|
||||||
watch,
|
|
||||||
ref,
|
|
||||||
onMounted,
|
|
||||||
unref,
|
|
||||||
} from 'vue';
|
|
||||||
import { TreeSelect } from 'ant-design-vue';
|
import { TreeSelect } from 'ant-design-vue';
|
||||||
import { isArray, isFunction } from '/@/utils/is';
|
import { isArray, isFunction } from '/@/utils/is';
|
||||||
import { get } from 'lodash-es';
|
import { get } from 'lodash-es';
|
||||||
|
Loading…
Reference in New Issue
Block a user