修改商品添加

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>
</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>
</div>
</template>
@ -128,11 +129,19 @@ const product_list_remove = (index: number) => {
form.value.product_list.splice(index, 1);
};
const add = () => {
form.value.product_list.push({
id: get_math(),
src: 'carousel',
new_src: [],
href: {},
url_value_dialog_visible.value = true;
};
//
const url_value_dialog_visible = ref(false);
//
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
const { form, new_style } = toRefs(state);
const tabs_list = ref({
content: {
...toRefs(form.value),
...toRefs(form.value.tabs_list[0]),
},
style: {
...toRefs(new_style.value),
const tabs_list = ref({});
watchEffect(() => {
tabs_list.value = {
content: {
...toRefs(form.value),
...toRefs(form.value.tabs_list[0]),
},
style: {
...toRefs(new_style.value),
}
}
})
console.log(tabs_list.value);