|
|
@@ -131,7 +131,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, reactive, computed, onMounted } from "vue";
|
|
|
+import { ref, reactive, computed, onMounted, nextTick } from "vue";
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import type { FormInstance, FormRules } from "element-plus";
|
|
|
import { Picture } from "@element-plus/icons-vue";
|
|
|
@@ -254,10 +254,12 @@ const rules = reactive<FormRules>({
|
|
|
});
|
|
|
|
|
|
// Tab切换
|
|
|
-const handleTabClick = async () => {
|
|
|
+const handleTabClick = async val => {
|
|
|
pageable.pageNum = 1;
|
|
|
- await loadDishList();
|
|
|
- updatePagination();
|
|
|
+ nextTick(async () => {
|
|
|
+ await loadDishList();
|
|
|
+ updatePagination();
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
// 更新分页总数
|
|
|
@@ -540,6 +542,7 @@ const loadDishList = async () => {
|
|
|
|
|
|
// 根据tab切换调用不同的dishType参数
|
|
|
// dishType: 0表示菜单, 1表示推荐
|
|
|
+ console.log(activeTab.value, activeTab.value === "recommended" ? 1 : 0, "zz---xx");
|
|
|
const dishType = activeTab.value === "recommended" ? 1 : 0;
|
|
|
const res: any = await getDishList({ storeId: Number(storeId), dishType });
|
|
|
|