xingyu4j 5 месяцев назад
Родитель
Сommit
af3fe53ec8

+ 1 - 4
apps/web-antd/src/views/_core/profile/password-setting.vue

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

+ 1 - 4
apps/web-ele/src/views/_core/profile/password-setting.vue

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

+ 1 - 4
apps/web-naive/src/views/_core/profile/password-setting.vue

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

+ 1 - 4
apps/web-tdesign/src/views/_core/profile/password-setting.vue

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

+ 6 - 2
packages/@core/ui-kit/form-ui/src/form-render/form.vue

@@ -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>

+ 7 - 2
packages/@core/ui-kit/layout-ui/src/components/layout-content.vue

@@ -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>

+ 2 - 3
packages/@core/ui-kit/layout-ui/src/components/layout-sidebar.vue

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

+ 2 - 2
packages/@core/ui-kit/menu-ui/src/components/menu.vue

@@ -351,14 +351,14 @@ 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="index">
           <component :is="item" />
         </template>
       </SubMenu>

+ 1 - 2
packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue

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

+ 2 - 4
packages/@core/ui-kit/popup-ui/src/modal/modal.vue

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

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/dropdown-menu/dropdown-radio-menu.vue

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

+ 3 - 5
packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue

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

+ 2 - 2
packages/@core/ui-kit/tabs-ui/src/tabs-view.vue

@@ -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"

+ 1 - 0
packages/effects/plugins/src/vxe-table/use-vxe-grid.vue

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

+ 1 - 4
playground/src/views/_core/profile/password-setting.vue

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

+ 1 - 0
playground/src/views/examples/vxe-table/basic.vue

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