修改商品添加

v1.0.0
于肖磊 2024-08-21 18:42:33 +08:00
parent ce1ab2c000
commit 3d1976211f
2 changed files with 25 additions and 12 deletions

View File

@ -52,6 +52,7 @@
<!-- 商品显示的配置信息 --> <!-- 商品显示的配置信息 -->
<product-show-config :value="form"></product-show-config> <product-show-config :value="form"></product-show-config>
</div> </div>
<url-value-dialog v-model:dialog-visible="url_value_dialog_visible" :type="['goods']" multiple @update:model-value="url_value_dialog_call_back"></url-value-dialog>
</el-form> </el-form>
</div> </div>
</template> </template>
@ -128,11 +129,19 @@ const product_list_remove = (index: number) => {
form.value.product_list.splice(index, 1); form.value.product_list.splice(index, 1);
}; };
const add = () => { const add = () => {
form.value.product_list.push({ url_value_dialog_visible.value = true;
id: get_math(), };
src: 'carousel', //
new_src: [], const url_value_dialog_visible = ref(false);
href: {}, //
const url_value_dialog_call_back = (item: any[]) => {
item.forEach((item: any) => {
form.value.product_list.push({
id: get_math(),
new_url: [],
new_title: item.title,
link: item,
});
}); });
}; };
// //

View File

@ -25,13 +25,17 @@ const state = reactive({
// 使toRefs // 使toRefs
const { form, new_style } = toRefs(state); const { form, new_style } = toRefs(state);
const tabs_list = ref({ const tabs_list = ref({});
content: {
...toRefs(form.value), watchEffect(() => {
...toRefs(form.value.tabs_list[0]), tabs_list.value = {
}, content: {
style: { ...toRefs(form.value),
...toRefs(new_style.value), ...toRefs(form.value.tabs_list[0]),
},
style: {
...toRefs(new_style.value),
}
} }
}) })
console.log(tabs_list.value); console.log(tabs_list.value);