修改商品页面的显示

v1.0.0
于肖磊 2024-08-22 09:54:05 +08:00
parent 3d1976211f
commit 3597eea5b5
2 changed files with 22 additions and 30 deletions

View File

@ -106,13 +106,9 @@ const props = defineProps({
default: true,
}
});
//
const state = reactive({
form: props.value?.content || {},
new_style: props.value?.style || {},
});
// 使toRefs
const { form, new_style } = toRefs(state);
const form = computed(() => props.value?.content || {});
const new_style = computed(() => props.value?.style || {});
//
interface product_list {

View File

@ -17,31 +17,27 @@ const props = defineProps({
},
},
});
//
const state = reactive({
form: props.value.content,
new_style: props.value.style,
});
// 使toRefs
const { form, new_style } = toRefs(state);
const tabs_list = ref({});
const style_container = ref('');
const tabs_list = ref(props.value);
watchEffect(() => {
tabs_list.value = {
content: {
...toRefs(form.value),
...toRefs(form.value.tabs_list[0]),
},
style: {
...toRefs(new_style.value),
}
}
})
console.log(tabs_list.value);
//
const style_container = computed(() => common_styles_computer(new_style.value.common_style));
watch(tabs_list.value, (val) => {
const new_style = val?.style;
let new_data = val;
//
new_data.content.product_check = new_data.content.tabs_list[0].product_check;
new_data.content.goods_category_ids = new_data.content.tabs_list[0].goods_category_ids;
new_data.content.goods_brand_ids = new_data.content.tabs_list[0].goods_brand_ids;
new_data.content.number = new_data.content.tabs_list[0].number;
new_data.content.is_price_solo = new_data.content.tabs_list[0].is_price_solo;
new_data.content.sort = new_data.content.tabs_list[0].sort;
new_data.content.sort_rules = new_data.content.tabs_list[0].sort_rules;
new_data.content.product_list = new_data.content.tabs_list[0].product_list;
tabs_list.value = new_data;
//
style_container.value += common_styles_computer(new_style.common_style);
},{ immediate: true, deep: true });
</script>
<style lang="scss" scoped>
</style>