From 678c0cd6e2273d1e42000d48ca18dbd3929160a4 Mon Sep 17 00:00:00 2001 From: Huangzhe Date: Sun, 23 Mar 2025 16:59:21 +0800 Subject: [PATCH] =?UTF-8?q?fix[create]:=20=E8=A7=A3=E5=86=B3=E7=BD=AE?= =?UTF-8?q?=E5=BA=95=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复属性无法访问 --- components.d.ts | 9 --------- src/views/Design/components/Questions/Choice.vue | 2 ++ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/components.d.ts b/components.d.ts index cc91605..fab8e77 100644 --- a/components.d.ts +++ b/components.d.ts @@ -8,14 +8,9 @@ export {} declare module 'vue' { export interface GlobalComponents { Contenteditable: typeof import('./src/components/contenteditable.vue')['default'] - ElButton: typeof import('element-plus/es')['ElButton'] - ElDropdown: typeof import('element-plus/es')['ElDropdown'] - ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] - ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] ElInput: typeof import('element-plus/es')['ElInput'] ElOption: typeof import('element-plus/es')['ElOption'] ElSelect: typeof import('element-plus/es')['ElSelect'] - ElSpace: typeof import('element-plus/es')['ElSpace'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElText: typeof import('element-plus/es')['ElText'] @@ -34,7 +29,6 @@ declare module 'vue' { VanGrid: typeof import('vant/es')['Grid'] VanGridItem: typeof import('vant/es')['GridItem'] VanIcon: typeof import('vant/es')['Icon'] - VanList: typeof import('vant/es')['List'] VanNavBar: typeof import('vant/es')['NavBar'] VanPicker: typeof import('vant/es')['Picker'] VanPopover: typeof import('vant/es')['Popover'] @@ -42,11 +36,8 @@ declare module 'vue' { VanRadio: typeof import('vant/es')['Radio'] VanRadioGroup: typeof import('vant/es')['RadioGroup'] VanRow: typeof import('vant/es')['Row'] - VanSearch: typeof import('vant/es')['Search'] VanStepper: typeof import('vant/es')['Stepper'] VanSwitch: typeof import('vant/es')['Switch'] - VanTab: typeof import('vant/es')['Tab'] - VanTabs: typeof import('vant/es')['Tabs'] YLCascader: typeof import('./src/components/YLCascader.vue')['default'] YLInput: typeof import('./src/components/YLInput.vue')['default'] YLPicker: typeof import('./src/components/YLPicker.vue')['default'] diff --git a/src/views/Design/components/Questions/Choice.vue b/src/views/Design/components/Questions/Choice.vue index 4863cc0..d6ce715 100644 --- a/src/views/Design/components/Questions/Choice.vue +++ b/src/views/Design/components/Questions/Choice.vue @@ -157,6 +157,8 @@ function handleChange(names) { const newOption = names[names.length - 1]; // 如果names 长度小于1,直接返回,不处理 if (names.length < 1) return; + // 如果不存在 options 和 list 属性,直接返回 + if (!element.value.options || !element.value.list) return; const options = element.value.options[0] ?? element.value.list[0]; // 如果新增的结果是排它项, 对结果进行处理