|
@@ -281,6 +281,14 @@ function handleChangeDropDownValue(index: number, value: number) {
|
|
|
dropDownValues.value[index] = value;
|
|
|
listLoader.loadData(undefined, true);
|
|
|
}
|
|
|
+function handleTabClick(e: any) {
|
|
|
+ if (e.jump) {
|
|
|
+ e.jump();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ tabCurrentIndex.value = e.index;
|
|
|
+ listLoader.loadData(undefined, true);
|
|
|
+}
|
|
|
function doSearch() {
|
|
|
listLoader.loadData(undefined, true);
|
|
|
}
|
|
@@ -302,13 +310,11 @@ function goDetails(item: any, id: number) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-function handleTabClick(e: any) {
|
|
|
- if (e.jump) {
|
|
|
- e.jump();
|
|
|
- return;
|
|
|
+function loadDropDownValues() {
|
|
|
+ dropDownValues.value = [];
|
|
|
+ for (const element of props.dropDownNames) {
|
|
|
+ dropDownValues.value.push(element.defaultSelectedValue);
|
|
|
}
|
|
|
- tabCurrentIndex.value = e.index;
|
|
|
- listLoader.loadData(undefined, true);
|
|
|
}
|
|
|
|
|
|
watch(tabCurrentIndex, () => {
|
|
@@ -319,6 +325,9 @@ watch(() => props.startTabIndex, () => {
|
|
|
tabCurrentIndex.value = props.startTabIndex;
|
|
|
}
|
|
|
});
|
|
|
+watch(() => props.dropDownNames, () => {
|
|
|
+ loadDropDownValues();
|
|
|
+});
|
|
|
|
|
|
defineExpose({
|
|
|
load: () => {
|
|
@@ -332,8 +341,7 @@ onMounted(() => {
|
|
|
tabCurrentIndex.value = props.startTabIndex;
|
|
|
if (props.title)
|
|
|
uni.setNavigationBarTitle({ title: props.title, })
|
|
|
- for (const element of props.dropDownNames)
|
|
|
- dropDownValues.value.push(element.defaultSelectedValue);
|
|
|
+ loadDropDownValues();
|
|
|
if (props.loadMounted)
|
|
|
listLoader.loadData(undefined, true);
|
|
|
}, 300);
|