【代码优化】MALL: 修复模板装修时组件属性响应式丢失的问题

This commit is contained in:
puhui999 2025-01-19 13:44:04 +08:00
parent 625426566c
commit 391a1481c6

View File

@ -68,13 +68,18 @@ import { useVModel } from '@vueuse/core'
// //
defineOptions({ name: 'NavigationBarCellProperty' }) defineOptions({ name: 'NavigationBarCellProperty' })
const props = defineProps<{ const props = withDefaults(
modelValue: NavigationBarCellProperty[] defineProps<{
isMp: boolean modelValue: NavigationBarCellProperty[]
}>() isMp: boolean
}>(),
{
modelValue: () => [],
isMp: true
}
)
const emit = defineEmits(['update:modelValue']) const emit = defineEmits(['update:modelValue'])
const { formData: cellList } = usePropertyForm(props.modelValue, emit) const cellList = useVModel(props, 'modelValue', emit)
if (!cellList.value) cellList.value = []
// 628 // 628
const cellCount = computed(() => (props.isMp ? 6 : 8)) const cellCount = computed(() => (props.isMp ? 6 : 8))