This commit is contained in:
@@ -2,20 +2,33 @@
|
||||
import {ref, onMounted} from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import MerList from '@/components/MerList.vue';
|
||||
import Storelist from '@/components/StoreList.vue';
|
||||
|
||||
const classId = ref();
|
||||
|
||||
const name = ref('');
|
||||
|
||||
onMounted(() => {
|
||||
const e = Taro.getCurrentInstance().router?.params as any;
|
||||
Taro.setNavigationBarTitle({
|
||||
title: e.name,
|
||||
});
|
||||
classId.value = Number(e.id);
|
||||
if (e.id) {
|
||||
Taro.setNavigationBarTitle({
|
||||
title: e.name,
|
||||
});
|
||||
classId.value = Number(e.id);
|
||||
} else {
|
||||
Taro.setNavigationBarTitle({
|
||||
title: '搜索列表',
|
||||
});
|
||||
name.value = e.name;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<MerList v-model="classId" />
|
||||
<view>
|
||||
<MerList v-if="classId" v-model="classId" />
|
||||
<Storelist v-else v-model="name" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss"></style>
|
||||
|
||||
Reference in New Issue
Block a user