fix: type error

This commit is contained in:
xingyu4j
2025-12-22 17:50:06 +08:00
parent e981fb159f
commit af3fe53ec8
16 changed files with 33 additions and 43 deletions

View File

@@ -1,14 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import { computed, ref } from 'vue'; import { computed } from 'vue';
import { ProfilePasswordSetting, z } from '@vben/common-ui'; import { ProfilePasswordSetting, z } from '@vben/common-ui';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
const profilePasswordSettingRef = ref();
const formSchema = computed((): VbenFormSchema[] => { const formSchema = computed((): VbenFormSchema[] => {
return [ return [
{ {
@@ -58,7 +56,6 @@ function handleSubmit() {
</script> </script>
<template> <template>
<ProfilePasswordSetting <ProfilePasswordSetting
ref="profilePasswordSettingRef"
class="w-1/3" class="w-1/3"
:form-schema="formSchema" :form-schema="formSchema"
@submit="handleSubmit" @submit="handleSubmit"

View File

@@ -1,14 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import { computed, ref } from 'vue'; import { computed } from 'vue';
import { ProfilePasswordSetting, z } from '@vben/common-ui'; import { ProfilePasswordSetting, z } from '@vben/common-ui';
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
const profilePasswordSettingRef = ref();
const formSchema = computed((): VbenFormSchema[] => { const formSchema = computed((): VbenFormSchema[] => {
return [ return [
{ {
@@ -58,7 +56,6 @@ function handleSubmit() {
</script> </script>
<template> <template>
<ProfilePasswordSetting <ProfilePasswordSetting
ref="profilePasswordSettingRef"
class="w-1/3" class="w-1/3"
:form-schema="formSchema" :form-schema="formSchema"
@submit="handleSubmit" @submit="handleSubmit"

View File

@@ -1,14 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import { computed, ref } from 'vue'; import { computed } from 'vue';
import { ProfilePasswordSetting, z } from '@vben/common-ui'; import { ProfilePasswordSetting, z } from '@vben/common-ui';
import { message } from '#/adapter/naive'; import { message } from '#/adapter/naive';
const profilePasswordSettingRef = ref();
const formSchema = computed((): VbenFormSchema[] => { const formSchema = computed((): VbenFormSchema[] => {
return [ return [
{ {
@@ -58,7 +56,6 @@ function handleSubmit() {
</script> </script>
<template> <template>
<ProfilePasswordSetting <ProfilePasswordSetting
ref="profilePasswordSettingRef"
class="w-1/3" class="w-1/3"
:form-schema="formSchema" :form-schema="formSchema"
@submit="handleSubmit" @submit="handleSubmit"

View File

@@ -1,14 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import { computed, ref } from 'vue'; import { computed } from 'vue';
import { ProfilePasswordSetting, z } from '@vben/common-ui'; import { ProfilePasswordSetting, z } from '@vben/common-ui';
import { message } from '#/adapter/tdesign'; import { message } from '#/adapter/tdesign';
const profilePasswordSettingRef = ref();
const formSchema = computed((): VbenFormSchema[] => { const formSchema = computed((): VbenFormSchema[] => {
return [ return [
{ {
@@ -58,7 +56,6 @@ function handleSubmit() {
</script> </script>
<template> <template>
<ProfilePasswordSetting <ProfilePasswordSetting
ref="profilePasswordSettingRef"
class="w-1/3" class="w-1/3"
:form-schema="formSchema" :form-schema="formSchema"
@submit="handleSubmit" @submit="handleSubmit"

View File

@@ -53,7 +53,11 @@ const wrapperClass = computed(() => {
provideFormRenderProps(props); provideFormRenderProps(props);
const { isCalculated, keepFormItemIndex, wrapperRef } = useExpandable(props); const {
isCalculated,
keepFormItemIndex,
wrapperRef: _wrapperRef,
} = useExpandable(props);
const shapes = computed(() => { const shapes = computed(() => {
const resultShapes: FormShape[] = []; const resultShapes: FormShape[] = [];
@@ -170,7 +174,7 @@ const computedSchema = computed(
<template> <template>
<component :is="formComponent" v-bind="formComponentProps"> <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"> <template v-for="cSchema in computedSchema" :key="cSchema.fieldName">
<!-- <div v-if="$slots[cSchema.fieldName]" :class="cSchema.formItemClass"> <!-- <div v-if="$slots[cSchema.fieldName]" :class="cSchema.formItemClass">
<slot :definition="cSchema" :name="cSchema.fieldName"> </slot> <slot :definition="cSchema" :name="cSchema.fieldName"> </slot>

View File

@@ -26,7 +26,8 @@ interface Props {
const props = withDefaults(defineProps<Props>(), {}); const props = withDefaults(defineProps<Props>(), {});
const { contentElement, overlayStyle } = useLayoutContentStyle(); const { contentElement: _contentElement, overlayStyle } =
useLayoutContentStyle();
const style = computed((): CSSProperties => { const style = computed((): CSSProperties => {
const { const {
@@ -55,7 +56,11 @@ const style = computed((): CSSProperties => {
</script> </script>
<template> <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 :style="overlayStyle">
<slot name="overlay"></slot> <slot name="overlay"></slot>
</Slot> </Slot>

View File

@@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { CSSProperties } from 'vue'; import type { CSSProperties } from 'vue';
import { computed, shallowRef, useSlots, watchEffect } from 'vue'; import { computed, useSlots, watchEffect } from 'vue';
import { VbenScrollbar } from '@vben-core/shadcn-ui'; import { VbenScrollbar } from '@vben-core/shadcn-ui';
@@ -114,7 +114,7 @@ const extraVisible = defineModel<boolean>('extraVisible');
const isLocked = useScrollLock(document.body); const isLocked = useScrollLock(document.body);
const slots = useSlots(); const slots = useSlots();
const asideRef = shallowRef<HTMLDivElement | null>(); // const asideRef = shallowRef<HTMLDivElement | null>();
const hiddenSideStyle = computed((): CSSProperties => calcMenuWidthStyle(true)); const hiddenSideStyle = computed((): CSSProperties => calcMenuWidthStyle(true));
@@ -290,7 +290,6 @@ function handleMouseleave() {
/> />
<div <div
v-if="isSidebarMixed" v-if="isSidebarMixed"
ref="asideRef"
:class="{ :class="{
'border-l': extraVisible, 'border-l': extraVisible,
}" }"

View File

@@ -351,14 +351,14 @@ function getActivePaths() {
role="menu" role="menu"
> >
<template v-if="mode === 'horizontal' && getSlot.showSlotMore"> <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" /> <component :is="item" />
</template> </template>
<SubMenu is-sub-menu-more path="sub-menu-more"> <SubMenu is-sub-menu-more path="sub-menu-more">
<template #title> <template #title>
<Ellipsis class="size-4" /> <Ellipsis class="size-4" />
</template> </template>
<template v-for="item in getSlot.slotMore" :key="item.key"> <template v-for="(item, index) in getSlot.slotMore" :key="index">
<component :is="item" /> <component :is="item" />
</template> </template>
</SubMenu> </SubMenu>

View File

@@ -54,7 +54,7 @@ const components = globalShareState.getComponents();
const id = useId(); const id = useId();
provide('DISMISSABLE_DRAWER_ID', id); provide('DISMISSABLE_DRAWER_ID', id);
const wrapperRef = ref<HTMLElement>(); // const wrapperRef = ref<HTMLElement>();
const { $t } = useSimpleLocale(); const { $t } = useSimpleLocale();
const { isMobile } = useIsMobile(); const { isMobile } = useIsMobile();
@@ -281,7 +281,6 @@ const getForceMount = computed(() => {
</VisuallyHidden> </VisuallyHidden>
</template> </template>
<div <div
ref="wrapperRef"
:class=" :class="
cn('relative flex-1 overflow-y-auto p-3', contentClass, { cn('relative flex-1 overflow-y-auto p-3', contentClass, {
'pointer-events-none': showLoading || submitting, 'pointer-events-none': showLoading || submitting,

View File

@@ -50,10 +50,10 @@ const props = withDefaults(defineProps<Props>(), {
const components = globalShareState.getComponents(); const components = globalShareState.getComponents();
const contentRef = ref(); const contentRef = ref();
const wrapperRef = ref<HTMLElement>(); // const wrapperRef = ref<HTMLElement>();
const dialogRef = ref(); const dialogRef = ref();
const headerRef = ref(); const headerRef = ref();
const footerRef = ref(); // const footerRef = ref();
const id = useId(); const id = useId();
@@ -306,7 +306,6 @@ function handleClosed() {
</VisuallyHidden> </VisuallyHidden>
</DialogHeader> </DialogHeader>
<div <div
ref="wrapperRef"
:class=" :class="
cn('relative min-h-40 flex-1 overflow-y-auto p-3', contentClass, { cn('relative min-h-40 flex-1 overflow-y-auto p-3', contentClass, {
'pointer-events-none': showLoading || submitting, 'pointer-events-none': showLoading || submitting,
@@ -327,7 +326,6 @@ function handleClosed() {
<DialogFooter <DialogFooter
v-if="showFooter" v-if="showFooter"
ref="footerRef"
:class=" :class="
cn( cn(
'flex-row items-center justify-end p-2', 'flex-row items-center justify-end p-2',

View File

@@ -27,7 +27,7 @@ function handleItemClick(value: string) {
</DropdownMenuTrigger> </DropdownMenuTrigger>
<DropdownMenuContent align="start"> <DropdownMenuContent align="start">
<DropdownMenuGroup> <DropdownMenuGroup>
<template v-for="menu in menus" :key="menu.key"> <template v-for="(menu, index) in menus" :key="index">
<DropdownMenuItem <DropdownMenuItem
:class=" :class="
menu.value === modelValue menu.value === modelValue

View File

@@ -3,7 +3,7 @@ import type { TabDefinition } from '@vben-core/typings';
import type { TabConfig, TabsProps } from '../../types'; import type { TabConfig, TabsProps } from '../../types';
import { computed, ref } from 'vue'; import { computed } from 'vue';
import { Pin, X } from '@vben-core/icons'; import { Pin, X } from '@vben-core/icons';
import { VbenContextMenu, VbenIcon } from '@vben-core/shadcn-ui'; import { VbenContextMenu, VbenIcon } from '@vben-core/shadcn-ui';
@@ -28,8 +28,8 @@ const emit = defineEmits<{
}>(); }>();
const active = defineModel<string>('active'); const active = defineModel<string>('active');
const contentRef = ref(); // const contentRef = ref();
const tabRef = ref(); // const tabRef = ref();
const style = computed(() => { const style = computed(() => {
const { gap } = props; const { gap } = props;
@@ -73,7 +73,6 @@ function onMouseDown(e: MouseEvent, tab: TabConfig) {
<template> <template>
<div <div
ref="contentRef"
:class="contentClass" :class="contentClass"
:style="style" :style="style"
class="tabs-chrome !flex h-full w-max overflow-y-hidden pr-6" class="tabs-chrome !flex h-full w-max overflow-y-hidden pr-6"
@@ -82,7 +81,6 @@ function onMouseDown(e: MouseEvent, tab: TabConfig) {
<div <div
v-for="(tab, i) in tabsView" v-for="(tab, i) in tabsView"
:key="tab.key" :key="tab.key"
ref="tabRef"
:class="[ :class="[
{ {
'is-active': tab.key === active, 'is-active': tab.key === active,

View File

@@ -29,7 +29,7 @@ const forward = useForwardPropsEmits(props, emit);
const { const {
handleScrollAt, handleScrollAt,
handleWheel, handleWheel,
scrollbarRef, scrollbarRef: _scrollbarRef,
scrollDirection, scrollDirection,
scrollIsAtLeft, scrollIsAtLeft,
scrollIsAtRight, scrollIsAtRight,
@@ -69,7 +69,7 @@ useTabsDrag(props, emit);
class="size-full flex-1 overflow-hidden" class="size-full flex-1 overflow-hidden"
> >
<VbenScrollbar <VbenScrollbar
ref="scrollbarRef" ref="_scrollbarRef"
:shadow-bottom="false" :shadow-bottom="false"
:shadow-top="false" :shadow-top="false"
class="h-full" class="h-full"

View File

@@ -315,6 +315,7 @@ async function init() {
'[Vben Vxe Table]: The formConfig in the grid is not supported, please use the `formOptions` props', '[Vben Vxe Table]: The formConfig in the grid is not supported, please use the `formOptions` props',
); );
} }
// @ts-ignore
props.api?.setState?.({ gridOptions: defaultGridOptions }); props.api?.setState?.({ gridOptions: defaultGridOptions });
// form 由 vben-form 代替所以需要保证query相关事件可以拿到参数 // form 由 vben-form 代替所以需要保证query相关事件可以拿到参数
extendProxyOptions(props.api, defaultGridOptions, () => extendProxyOptions(props.api, defaultGridOptions, () =>

View File

@@ -1,14 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import type { VbenFormSchema } from '#/adapter/form'; import type { VbenFormSchema } from '#/adapter/form';
import { computed, ref } from 'vue'; import { computed } from 'vue';
import { ProfilePasswordSetting, z } from '@vben/common-ui'; import { ProfilePasswordSetting, z } from '@vben/common-ui';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
const profilePasswordSettingRef = ref();
const formSchema = computed((): VbenFormSchema[] => { const formSchema = computed((): VbenFormSchema[] => {
return [ return [
{ {
@@ -58,7 +56,6 @@ function handleSubmit() {
</script> </script>
<template> <template>
<ProfilePasswordSetting <ProfilePasswordSetting
ref="profilePasswordSettingRef"
class="w-1/3" class="w-1/3"
:form-schema="formSchema" :form-schema="formSchema"
@submit="handleSubmit" @submit="handleSubmit"

View File

@@ -43,6 +43,7 @@ const gridEvents: VxeGridListeners<RowType> = {
}, },
}; };
// @ts-ignore
const [Grid, gridApi] = useVbenVxeGrid<RowType>({ const [Grid, gridApi] = useVbenVxeGrid<RowType>({
// 放开注释查看表单组件的类型 // 放开注释查看表单组件的类型
// formOptions: { // formOptions: {