修改显示逻辑
parent
3f30dd1689
commit
525c85e95a
|
|
@ -55,8 +55,10 @@ const props = defineProps({
|
|||
});
|
||||
watch(
|
||||
() => props.reset,
|
||||
() => {
|
||||
init();
|
||||
(val) => {
|
||||
if (val) {
|
||||
init();
|
||||
}
|
||||
}
|
||||
);
|
||||
onMounted(() => {
|
||||
|
|
|
|||
|
|
@ -56,8 +56,10 @@ const props = defineProps({
|
|||
});
|
||||
watch(
|
||||
() => props.reset,
|
||||
() => {
|
||||
init();
|
||||
(val) => {
|
||||
if (val) {
|
||||
init();
|
||||
}
|
||||
}
|
||||
);
|
||||
onMounted(() => {
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ watch(
|
|||
);
|
||||
watch(
|
||||
() => props.reset,
|
||||
() => {
|
||||
(val) => {
|
||||
reset_data();
|
||||
custom_type_active.value = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,12 +73,12 @@ const filterData = (input: string, data: pageLinkList[]) => {
|
|||
// 遍历数组
|
||||
for (let item of data) {
|
||||
// 检查当前项的name是否匹配
|
||||
if (item.name.includes(input)) {
|
||||
if (item.name && item.name.includes(input)) {
|
||||
result.push(item);
|
||||
} else {
|
||||
if (item.items) {
|
||||
// 否则,检查当前项的data属性中的子项
|
||||
let subResult = item.items.filter((subItem) => subItem.name.includes(input));
|
||||
let subResult = item.items.filter((subItem) => subItem.name && subItem.name.includes(input));
|
||||
// 如果找到匹配的子项,将当前项(父级)添加到结果中
|
||||
if (subResult.length > 0) {
|
||||
result.push({ ...item, items: subResult });
|
||||
|
|
@ -87,7 +87,7 @@ const filterData = (input: string, data: pageLinkList[]) => {
|
|||
let result_child: pageLinkList[] = [];
|
||||
item.items.forEach((child: pageLinkList) => {
|
||||
if (child.items) {
|
||||
let subResult = child.items.filter((subItem) => subItem.name.includes(input));
|
||||
let subResult = child.items.filter((subItem) => subItem.name && subItem.name.includes(input));
|
||||
if (subResult.length > 0) {
|
||||
result_child.push({ ...child, items: subResult });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,8 +83,10 @@ watch(
|
|||
);
|
||||
watch(
|
||||
() => props.reset,
|
||||
() => {
|
||||
init();
|
||||
(val) => {
|
||||
if (val) {
|
||||
init();
|
||||
}
|
||||
}
|
||||
);
|
||||
const emit = defineEmits(['update:link', 'type']);
|
||||
|
|
|
|||
|
|
@ -58,8 +58,10 @@ const props = defineProps({
|
|||
});
|
||||
watch(
|
||||
() => props.reset,
|
||||
() => {
|
||||
init();
|
||||
(val) => {
|
||||
if (val) {
|
||||
init();
|
||||
}
|
||||
}
|
||||
);
|
||||
onMounted(() => {
|
||||
|
|
@ -80,6 +82,7 @@ const init = () => {
|
|||
search_value.value = '';
|
||||
category_list.value = url_value_store.url_value.goods_category;
|
||||
brand_list.value = url_value_store.url_value.brand_list;
|
||||
console.log('1111122');
|
||||
get_list(1);
|
||||
};
|
||||
const handle_search = () => {
|
||||
|
|
|
|||
|
|
@ -48,8 +48,10 @@ const props = defineProps({
|
|||
});
|
||||
watch(
|
||||
() => props.reset,
|
||||
() => {
|
||||
init();
|
||||
(val) => {
|
||||
if (val) {
|
||||
init();
|
||||
}
|
||||
}
|
||||
);
|
||||
const modelValue = defineModel({ type: Array, default: [] });
|
||||
|
|
@ -84,12 +86,12 @@ const filterData = (input: string, data: pageLinkList[]) => {
|
|||
// 遍历数组
|
||||
for (let item of data) {
|
||||
// 检查当前项的name是否匹配
|
||||
if (item.name.includes(input)) {
|
||||
if (item.name && item.name.includes(input)) {
|
||||
result.push(item);
|
||||
} else {
|
||||
if (item.data) {
|
||||
// 否则,检查当前项的data属性中的子项
|
||||
let subResult = item.data.filter((subItem) => subItem.name.includes(input));
|
||||
let subResult = item.data.filter((subItem) => subItem.name && subItem.name.includes(input));
|
||||
// 如果找到匹配的子项,将当前项(父级)添加到结果中
|
||||
if (subResult.length > 0) {
|
||||
result.push({ ...item, data: subResult });
|
||||
|
|
|
|||
|
|
@ -55,8 +55,10 @@ const props = defineProps({
|
|||
});
|
||||
watch(
|
||||
() => props.reset,
|
||||
() => {
|
||||
init();
|
||||
(val) => {
|
||||
if (val) {
|
||||
init();
|
||||
}
|
||||
}
|
||||
);
|
||||
onMounted(() => {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
</div>
|
||||
<div v-if="form.is_shop_show">
|
||||
<template v-if="form.shop_type == 'text'">
|
||||
<div class="plr-11 ptb-6 round cr-f" :style="trends_config('button', 'gradient') + `color: ${ new_style.shop_button_text_color };`">{{ form.shop_button_text }}</div>
|
||||
<div class="plr-11 ptb-3 round cr-f" :style="trends_config('button', 'gradient') + `color: ${ new_style.shop_button_text_color };`">{{ form.shop_button_text }}</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<icon class="round plr-6 ptb-5" :name="!isEmpty(form.shop_button_icon_class) ? form.shop_button_icon_class : 'cart'" :color="new_style.shop_icon_color" :size="new_style.shop_icon_size + ''" :styles="button_gradient()"></icon>
|
||||
|
|
@ -80,7 +80,7 @@
|
|||
</div>
|
||||
<div v-if="form.is_shop_show">
|
||||
<template v-if="form.shop_type == 'text'">
|
||||
<div class="plr-11 ptb-6 round cr-f" :style="trends_config('button', 'gradient') + `color: ${ new_style.shop_button_text_color };`">{{ form.shop_button_text }}</div>
|
||||
<div class="plr-11 ptb-3 round cr-f" :style="trends_config('button', 'gradient') + `color: ${ new_style.shop_button_text_color };`">{{ form.shop_button_text }}</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<icon class="round plr-6 ptb-5" :name="!isEmpty(form.shop_button_icon_class) ? form.shop_button_icon_class : 'cart'" :color="new_style.shop_icon_color" :size="new_style.shop_icon_size + ''" :styles="button_gradient()"></icon>
|
||||
|
|
|
|||
Loading…
Reference in New Issue