riku
2024-11-12 befd1f21839939b54254bd316bbd158b136fcd15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
export const useSortOptions = Behavior({
  data: {
    sort: '',
    sortBy: 'pro',
  },
  methods: {
    onSortChange(e) {
      const { sorts } = e.detail;
      const { type } = e.currentTarget.dataset;
      this.setData({
        sort: sorts,
        sortBy: type,
        proSort: type == 'pro' ? sorts : 'default',
        changeSort: type == 'changePer' ? sorts : 'default',
      });
      if (typeof this._startSortLoad === 'function') {
        this._startSortLoad()
      } else {
        this._startLoad();
      }
    },
  },
});