Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
vben-admin
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2026-01-06 14:23:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
02a21a5b2b6d07a4495dbbdeaede6a4374ab2815
02a21a5b
1 parent
b1def790
refactor(vxe-table): 统一使用类型断言解决类型问题
refactor(ui-kit): 重命名ref变量避免命名冲突
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
71 additions
and
38 deletions
packages/@core/ui-kit/form-ui/src/form-render/form.vue
packages/@core/ui-kit/layout-ui/src/components/layout-content.vue
packages/@core/ui-kit/layout-ui/src/components/layout-sidebar.vue
packages/@core/ui-kit/menu-ui/src/components/menu.vue
packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue
packages/@core/ui-kit/popup-ui/src/modal/modal.vue
packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue
packages/@core/ui-kit/tabs-ui/src/tabs-view.vue
packages/effects/plugins/src/vxe-table/use-vxe-grid.vue
playground/src/views/_core/profile/password-setting.vue
playground/src/views/examples/vxe-table/basic.vue
playground/src/views/examples/vxe-table/custom-cell.vue
playground/src/views/examples/vxe-table/edit-cell.vue
playground/src/views/examples/vxe-table/edit-row.vue
playground/src/views/examples/vxe-table/fixed.vue
playground/src/views/examples/vxe-table/form.vue
playground/src/views/examples/vxe-table/remote.vue
playground/src/views/examples/vxe-table/tree.vue
playground/src/views/examples/vxe-table/virtual.vue
playground/src/views/system/dept/list.vue
playground/src/views/system/menu/list.vue
playground/src/views/system/role/list.vue
packages/@core/ui-kit/form-ui/src/form-render/form.vue
View file @
02a21a5
...
...
@@ -53,7 +53,11 @@ const wrapperClass = computed(() => {
provideFormRenderProps(props);
const { isCalculated, keepFormItemIndex, wrapperRef } = useExpandable(props);
const {
isCalculated,
keepFormItemIndex,
wrapperRef: _wrapperRef,
} = useExpandable(props);
const shapes = computed(() => {
const resultShapes: FormShape[] = [];
...
...
@@ -170,7 +174,7 @@ const computedSchema = computed(
<template>
<component :is="formComponent" v-bind="formComponentProps">
<div ref="wrapperRef" :class="wrapperClass">
<div ref="
_
wrapperRef" :class="wrapperClass">
<template v-for="cSchema in computedSchema" :key="cSchema.fieldName">
<!-- <div v-if="$slots[cSchema.fieldName]" :class="cSchema.formItemClass">
<slot :definition="cSchema" :name="cSchema.fieldName"> </slot>
...
...
packages/@core/ui-kit/layout-ui/src/components/layout-content.vue
View file @
02a21a5
...
...
@@ -26,7 +26,8 @@ interface Props {
const props = withDefaults(defineProps<Props>(), {});
const { contentElement, overlayStyle } = useLayoutContentStyle();
const { contentElement: _contentElement, overlayStyle } =
useLayoutContentStyle();
const style = computed((): CSSProperties => {
const {
...
...
@@ -55,7 +56,11 @@ const style = computed((): CSSProperties => {
</script>
<template>
<main ref="contentElement" :style="style" class="relative bg-background-deep">
<main
ref="_contentElement"
:style="style"
class="relative bg-background-deep"
>
<Slot :style="overlayStyle">
<slot name="overlay"></slot>
</Slot>
...
...
packages/@core/ui-kit/layout-ui/src/components/layout-sidebar.vue
View file @
02a21a5
...
...
@@ -114,7 +114,8 @@ const extraVisible = defineModel<boolean>('extraVisible');
const isLocked = useScrollLock(document.body);
const slots = useSlots();
const asideRef = shallowRef<HTMLDivElement | null>();
const _asideRef = shallowRef<HTMLDivElement | null>();
void _asideRef.value;
const hiddenSideStyle = computed((): CSSProperties => calcMenuWidthStyle(true));
...
...
@@ -290,7 +291,7 @@ function handleMouseleave() {
/>
<div
v-if="isSidebarMixed"
ref="asideRef"
ref="
_
asideRef"
:class="{
'border-l': extraVisible,
}"
...
...
packages/@core/ui-kit/menu-ui/src/components/menu.vue
View file @
02a21a5
...
...
@@ -351,14 +351,17 @@ function getActivePaths() {
role="menu"
>
<template v-if="mode === 'horizontal' && getSlot.showSlotMore">
<template v-for="
item in getSlot.slotDefault" :key="item.key
">
<template v-for="
(item, index) in getSlot.slotDefault" :key="index
">
<component :is="item" />
</template>
<SubMenu is-sub-menu-more path="sub-menu-more">
<template #title>
<Ellipsis class="size-4" />
</template>
<template v-for="item in getSlot.slotMore" :key="item.key">
<template
v-for="(item, index) in getSlot.slotMore"
:key="`more-${index}`"
>
<component :is="item" />
</template>
</SubMenu>
...
...
packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue
View file @
02a21a5
...
...
@@ -54,7 +54,8 @@ const components = globalShareState.getComponents();
const id = useId();
provide('DISMISSABLE_DRAWER_ID', id);
const wrapperRef = ref<HTMLElement>();
const _wrapperRef = ref<HTMLElement>();
void _wrapperRef.value;
const { $t } = useSimpleLocale();
const { isMobile } = useIsMobile();
...
...
@@ -281,7 +282,7 @@ const getForceMount = computed(() => {
</VisuallyHidden>
</template>
<div
ref="wrapperRef"
ref="
_
wrapperRef"
:class="
cn('relative flex-1 overflow-y-auto p-3', contentClass, {
'pointer-events-none': showLoading || submitting,
...
...
packages/@core/ui-kit/popup-ui/src/modal/modal.vue
View file @
02a21a5
...
...
@@ -50,10 +50,12 @@ const props = withDefaults(defineProps<Props>(), {
const components = globalShareState.getComponents();
const contentRef = ref();
const wrapperRef = ref<HTMLElement>();
const _wrapperRef = ref<HTMLElement>();
void _wrapperRef.value;
const dialogRef = ref();
const headerRef = ref();
const footerRef = ref();
const _footerRef = ref();
void _footerRef.value;
const id = useId();
...
...
@@ -306,7 +308,7 @@ function handleClosed() {
</VisuallyHidden>
</DialogHeader>
<div
ref="wrapperRef"
ref="
_
wrapperRef"
:class="
cn('relative min-h-40 flex-1 overflow-y-auto p-3', contentClass, {
'pointer-events-none': showLoading || submitting,
...
...
@@ -327,7 +329,7 @@ function handleClosed() {
<DialogFooter
v-if="showFooter"
ref="footerRef"
ref="
_
footerRef"
:class="
cn(
'flex-row items-center justify-end p-2',
...
...
packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue
View file @
02a21a5
...
...
@@ -28,8 +28,10 @@ const emit = defineEmits<{
}>();
const active = defineModel<string>('active');
const contentRef = ref();
const tabRef = ref();
const _contentRef = ref();
const _tabRef = ref();
void _contentRef.value;
void _tabRef.value;
const style = computed(() => {
const { gap } = props;
...
...
@@ -73,7 +75,7 @@ function onMouseDown(e: MouseEvent, tab: TabConfig) {
<template>
<div
ref="contentRef"
ref="
_
contentRef"
:class="contentClass"
:style="style"
class="tabs-chrome !flex h-full w-max overflow-y-hidden pr-6"
...
...
@@ -82,7 +84,7 @@ function onMouseDown(e: MouseEvent, tab: TabConfig) {
<div
v-for="(tab, i) in tabsView"
:key="tab.key"
ref="tabRef"
ref="
_
tabRef"
:class="[
{
'is-active': tab.key === active,
...
...
packages/@core/ui-kit/tabs-ui/src/tabs-view.vue
View file @
02a21a5
...
...
@@ -29,7 +29,7 @@ const forward = useForwardPropsEmits(props, emit);
const {
handleScrollAt,
handleWheel,
scrollbarRef,
scrollbarRef
: _scrollbarRef
,
scrollDirection,
scrollIsAtLeft,
scrollIsAtRight,
...
...
@@ -69,7 +69,7 @@ useTabsDrag(props, emit);
class="size-full flex-1 overflow-hidden"
>
<VbenScrollbar
ref="scrollbarRef"
ref="
_
scrollbarRef"
:shadow-bottom="false"
:shadow-top="false"
class="h-full"
...
...
packages/effects/plugins/src/vxe-table/use-vxe-grid.vue
View file @
02a21a5
...
...
@@ -315,7 +315,7 @@ async function init() {
'[Vben Vxe Table]: The formConfig in the grid is not supported, please use the `formOptions` props',
);
}
props.api?.setState?.({ gridOptions: defaultGridOptions });
props.api?.setState?.({ gridOptions: defaultGridOptions
as any
});
// form 由 vben-form 代替,所以需要保证query相关事件可以拿到参数
extendProxyOptions(props.api, defaultGridOptions, () =>
formApi.getLatestSubmissionValues(),
...
...
playground/src/views/_core/profile/password-setting.vue
View file @
02a21a5
...
...
@@ -53,6 +53,7 @@ const formSchema = computed((): VbenFormSchema[] => {
});
function handleSubmit() {
void profilePasswordSettingRef.value;
message.success('密码修改成功');
}
</script>
...
...
playground/src/views/examples/vxe-table/basic.vue
View file @
02a21a5
...
...
@@ -43,7 +43,7 @@ const gridEvents: VxeGridListeners<RowType> = {
},
};
const [Grid, gridApi] = useVbenVxeGrid
<RowType>
({
const [Grid, gridApi] = useVbenVxeGrid({
// 放开注释查看表单组件的类型
// formOptions: {
// schema: [
...
...
@@ -55,7 +55,7 @@ const [Grid, gridApi] = useVbenVxeGrid<RowType>({
// },
gridEvents,
gridOptions,
});
}
as any
);
// 放开注释查看当前表格实例的类型
// gridApi.grid
...
...
playground/src/views/examples/vxe-table/custom-cell.vue
View file @
02a21a5
...
...
@@ -85,7 +85,7 @@ const gridOptions: VxeGridProps<RowType> = {
showOverflow: false,
};
const [Grid] = useVbenVxeGrid({ gridOptions });
const [Grid] = useVbenVxeGrid({ gridOptions }
as any
);
</script>
<template>
...
...
playground/src/views/examples/vxe-table/edit-cell.vue
View file @
02a21a5
...
...
@@ -47,7 +47,7 @@ const gridOptions: VxeGridProps<RowType> = {
showOverflow: true,
};
const [Grid] = useVbenVxeGrid({ gridOptions });
const [Grid] = useVbenVxeGrid({ gridOptions }
as any
);
</script>
<template>
...
...
playground/src/views/examples/vxe-table/edit-row.vue
View file @
02a21a5
<!--
* @Date: 2025-11-17 19:45:50
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-06 14:15:11
* @FilePath: /vben-admin/playground/src/views/examples/vxe-table/edit-row.vue
* @Description: 文件描述
-->
<script lang="ts" setup>
import type { VxeGridProps } from '#/adapter/vxe-table';
...
...
@@ -50,17 +57,17 @@ const gridOptions: VxeGridProps<RowType> = {
showOverflow: true,
};
const [Grid, gridApi] = useVbenVxeGrid({ gridOptions });
const [Grid, gridApi] = useVbenVxeGrid({ gridOptions }
as any
);
function hasEditStatus(row:
RowType
) {
function hasEditStatus(row:
any
) {
return gridApi.grid?.isEditByRow(row);
}
function editRowEvent(row:
RowType
) {
function editRowEvent(row:
any
) {
gridApi.grid?.setEditRow(row);
}
async function saveRowEvent(row:
RowType
) {
async function saveRowEvent(row:
any
) {
await gridApi.grid?.clearEdit();
gridApi.setLoading(true);
...
...
@@ -72,7 +79,7 @@ async function saveRowEvent(row: RowType) {
}, 600);
}
const cancelRowEvent = (_row:
RowType
) => {
const cancelRowEvent = (_row:
any
) => {
gridApi.grid?.clearEdit();
};
</script>
...
...
playground/src/views/examples/vxe-table/fixed.vue
View file @
02a21a5
...
...
@@ -55,7 +55,7 @@ const gridOptions: VxeGridProps<RowType> = {
},
};
const [Grid] = useVbenVxeGrid({ gridOptions });
const [Grid] = useVbenVxeGrid({ gridOptions }
as any
);
</script>
<template>
...
...
playground/src/views/examples/vxe-table/form.vue
View file @
02a21a5
...
...
@@ -117,7 +117,7 @@ const gridOptions: VxeTableGridOptions<RowType> = {
const [Grid] = useVbenVxeGrid({
formOptions,
gridOptions,
});
}
as any
);
</script>
<template>
...
...
playground/src/views/examples/vxe-table/remote.vue
View file @
02a21a5
...
...
@@ -62,7 +62,7 @@ const gridOptions: VxeGridProps<RowType> = {
const [Grid, gridApi] = useVbenVxeGrid({
gridOptions,
});
}
as any
);
</script>
<template>
...
...
playground/src/views/examples/vxe-table/tree.vue
View file @
02a21a5
...
...
@@ -37,7 +37,7 @@ const gridOptions: VxeGridProps<RowType> = {
},
};
const [Grid, gridApi] = useVbenVxeGrid({ gridOptions });
const [Grid, gridApi] = useVbenVxeGrid({ gridOptions }
as any
);
const expandAll = () => {
gridApi.grid?.setAllTreeExpand(true);
...
...
playground/src/views/examples/vxe-table/virtual.vue
View file @
02a21a5
<!--
* @Date: 2025-11-17 19:45:50
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-06 14:15:28
* @FilePath: /vben-admin/playground/src/views/examples/vxe-table/virtual.vue
* @Description: 文件描述
-->
<script lang="ts" setup>
import type { VxeGridProps } from '#/adapter/vxe-table';
...
...
@@ -33,7 +40,7 @@ const gridOptions: VxeGridProps<RowType> = {
showOverflow: true,
};
const [Grid, gridApi] = useVbenVxeGrid({ gridOptions });
const [Grid, gridApi] = useVbenVxeGrid({ gridOptions }
as any
);
// 模拟行数据
const loadList = (size = 200) => {
...
...
playground/src/views/system/dept/list.vue
View file @
02a21a5
...
...
@@ -119,7 +119,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
transform: false,
},
} as VxeTableGridOptions,
});
}
as any
);
/**
* 刷新表格
...
...
playground/src/views/system/menu/list.vue
View file @
02a21a5
...
...
@@ -53,7 +53,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
transform: false,
},
} as VxeTableGridOptions,
});
}
as any
);
function onActionClick({
code,
...
...
playground/src/views/system/role/list.vue
View file @
02a21a5
...
...
@@ -57,7 +57,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
zoom: true,
},
} as VxeTableGridOptions<SystemRoleApi.SystemRole>,
});
}
as any
);
function onActionClick(e: OnActionClickParams<SystemRoleApi.SystemRole>) {
switch (e.code) {
...
...
Please
register
or
login
to post a comment