Skip to content

Commit 391a148

Browse files
author
puhui999
committed
【代码优化】MALL: 修复模板装修时组件属性响应式丢失的问题
1 parent 6254265 commit 391a148

File tree

1 file changed

+11
-6
lines changed
  • src/components/DiyEditor/components/mobile/NavigationBar/components

1 file changed

+11
-6
lines changed

src/components/DiyEditor/components/mobile/NavigationBar/components/CellProperty.vue

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,18 @@ import { useVModel } from '@vueuse/core'
6868
// 导航栏属性面板
6969
defineOptions({ name: 'NavigationBarCellProperty' })
7070
71-
const props = defineProps<{
72-
modelValue: NavigationBarCellProperty[]
73-
isMp: boolean
74-
}>()
71+
const props = withDefaults(
72+
defineProps<{
73+
modelValue: NavigationBarCellProperty[]
74+
isMp: boolean
75+
}>(),
76+
{
77+
modelValue: () => [],
78+
isMp: true
79+
}
80+
)
7581
const emit = defineEmits(['update:modelValue'])
76-
const { formData: cellList } = usePropertyForm(props.modelValue, emit)
77-
if (!cellList.value) cellList.value = []
82+
const cellList = useVModel(props, 'modelValue', emit)
7883
7984
// 单元格数量:小程序6个(右侧胶囊按钮占了2个),其它平台8个
8085
const cellCount = computed(() => (props.isMp ? 6 : 8))

0 commit comments

Comments
 (0)