瀏覽代碼

RegionList - ordered

master
Kobus 5 年之前
父節點
當前提交
78307f43ad
共有 2 個檔案被更改,包括 5 行新增1 行删除
  1. 4
    1
      src/components/timeshare/buy/buyPage.vue
  2. 1
    0
      src/store/modules/timeshare/buyPage.js

+ 4
- 1
src/components/timeshare/buy/buyPage.vue 查看文件

@@ -38,7 +38,7 @@
38 38
           <div class="row mb-4">
39 39
             <div class="col-md-8">
40 40
               <div class="accordion" id="accordionExample">
41
-                <div class="card" v-for="(region, r) in detailedRegion" :key="r">
41
+                <div class="card" v-for="(region, r) in regions" :key="r">
42 42
                   <a
43 43
                     class="btn btn-b-n"
44 44
                     type="button"
@@ -86,6 +86,9 @@ export default {
86 86
   },
87 87
   computed: {
88 88
     ...mapState('timeshareBuy', ['detailedRegion']),
89
+    regions(){
90
+      return _.sortBy(this.detailedRegion, r => r.regionName);
91
+    }
89 92
   },
90 93
   methods: {
91 94
     ...mapActions('timeshareBuy', ['getRegions']),

+ 1
- 0
src/store/modules/timeshare/buyPage.js 查看文件

@@ -1,6 +1,7 @@
1 1
 /* eslint-disable no-restricted-syntax */
2 2
 /* eslint-disable guard-for-in */
3 3
 import axios from 'axios';
4
+import _ from 'lodash';
4 5
 
5 6
 export default {
6 7
   namespaced: true,

Loading…
取消
儲存