新增商品拼团模块

This commit is contained in:
gyq
2025-12-18 14:49:56 +08:00
parent a20379890e
commit 8826b206df
12 changed files with 3110 additions and 5 deletions

View File

@@ -15,7 +15,8 @@
</view>
</view>
<view class="right" v-if="showSwitch">
<u-switch :active-value="1" :inactive-value="0" v-model="isOpen" @change="defineEmits(['update:isOpen'])"></u-switch>
<!-- 关键修复删掉错误的 @change 绑定defineModel 已自动处理双向绑定 -->
<u-switch :active-value="1" :inactive-value="0" v-model="isOpen"></u-switch>
</view>
</view>
</view>
@@ -27,11 +28,12 @@ import { ref, onMounted, nextTick } from 'vue';
const props = defineProps({
options: {
type: Object,
default: {
default: () => ({
// 注意:对象/数组默认值推荐用函数,避免引用共享
name: '标题',
intro: '说明',
icon: 'xszk'
}
})
},
showSwitch: {
type: Boolean,
@@ -41,11 +43,13 @@ const props = defineProps({
const headHeight = ref(70);
// defineModel 是 Vue3.4+ 语法糖,自动实现 v-model:isOpen 的双向绑定
const isOpen = defineModel('isOpen', {
type: [Boolean, String, Number],
default: 0
});
// 声明自定义 emit 事件(仅在 script setup 内使用)
const emits = defineEmits(['load']);
onMounted(() => {