修改显示逻辑

v1.0.0
于肖磊 2024-08-27 17:07:52 +08:00
parent 3f30dd1689
commit 525c85e95a
9 changed files with 33 additions and 20 deletions

View File

@ -55,8 +55,10 @@ const props = defineProps({
});
watch(
() => props.reset,
() => {
init();
(val) => {
if (val) {
init();
}
}
);
onMounted(() => {

View File

@ -56,8 +56,10 @@ const props = defineProps({
});
watch(
() => props.reset,
() => {
init();
(val) => {
if (val) {
init();
}
}
);
onMounted(() => {

View File

@ -67,7 +67,7 @@ watch(
);
watch(
() => props.reset,
() => {
(val) => {
reset_data();
custom_type_active.value = 0;
}

View File

@ -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 });
}

View File

@ -83,8 +83,10 @@ watch(
);
watch(
() => props.reset,
() => {
init();
(val) => {
if (val) {
init();
}
}
);
const emit = defineEmits(['update:link', 'type']);

View File

@ -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 = () => {

View File

@ -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 });

View File

@ -55,8 +55,10 @@ const props = defineProps({
});
watch(
() => props.reset,
() => {
init();
(val) => {
if (val) {
init();
}
}
);
onMounted(() => {

View File

@ -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>