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(); } }, }, });