Преглед изворни кода

食物如果是录入的默认按时间排序,如果是导入的默认按id排序

wangyang пре 5 година
родитељ
комит
7012e06733
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      src/views/food/index.vue

+ 5 - 0
src/views/food/index.vue

@@ -217,6 +217,11 @@ export default {
   },
   created() {
     this.foodSource = getFoodSourceByUrl(this.$route.path)
+    if (this.foodSource === 'ENTRY' || this.foodSource === '') {
+      this.listQuery.orderBy = 0
+    } else {
+      this.listQuery.orderBy = 1
+    }
     this.fetchData()
   },
   methods: {