Browse Source

[WHAT] 修正Sort卡片手機版下拉選單回傳值

Dev
berlin-tzen 2 years ago
parent
commit
2fef85020a
  1. 13
      FrontEnd/components/newComponent/sort/sort.vue

13
FrontEnd/components/newComponent/sort/sort.vue

@ -42,10 +42,10 @@
<button class="btn-filter tw-text-transparent" @click="$emit('filter', true)">
filter
</button>
<select class="tw-py-[9px] tw-rounded-[10px]" name="sort_by" v-model="sort" @change="onChnage">
<select class="tw-py-[9px] tw-rounded-[10px]" name="sort_by" v-model="sort" @change="onChnage()">
<option value="0">{{ $t("Select option") }}</option>
<!-- <option v-for="(item, index) in sortType" :key="index" :value="item.value" :selected="sort = item.value"> -->
<option v-for="(item, index) in sortType" :key="index" :value="item.value">
<option v-for="(item, index) in sortType" :key=item.name :value="item.name">
{{ $t(item.value) }}
</option>
</select>
@ -66,8 +66,11 @@ export default {
},
},
data() {
return {
sort: this.sortBy ? this.sortBy : "0",
options: {}
};
},
watch: {
@ -78,14 +81,16 @@ export default {
},
sort: {
handler: function () {
this.$emit("change", this.sort);
// this.$emit("change", this.sort);
this.$emit("sort", this.sort);
},
},
},
methods: {
onClick(item) {
this.sort = item.name;
this.$emit("sort", this.sort);
// console.log(this.sort);
// this.$emit("sort", this.sort);
},
onChnage() {
this.$emit("sort", this.sort);

Loading…
Cancel
Save