mirror of
https://github.com/Kvan7/Exiled-Exchange-2.git
synced 2026-10-02 01:18:02 +00:00
change interaction
This commit is contained in:
@@ -11,8 +11,7 @@
|
||||
<filters-block v-if="!item.stackSize"
|
||||
:filters="itemFilters"
|
||||
:stats="itemStats"
|
||||
:item="item"
|
||||
@refine-search="refineSearch" />
|
||||
:item="item" />
|
||||
<trade-listing
|
||||
ref="tradeService"
|
||||
:filters="itemFilters"
|
||||
@@ -73,20 +72,13 @@ export default {
|
||||
MainProcess.priceCheckVisible(false)
|
||||
}
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
itemFilters: {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler (filters) {
|
||||
if (filters == null) return
|
||||
|
||||
// NOTE: children component receives props on nextTick
|
||||
this.$nextTick(() => {
|
||||
this.$refs.tradeService.execSearch()
|
||||
})
|
||||
}
|
||||
}
|
||||
this.$watch(vm => [vm.itemFilters, vm.itemStats], () => {
|
||||
// NOTE: children component receives props on nextTick
|
||||
this.$nextTick(() => {
|
||||
this.$refs.tradeService.execSearch()
|
||||
})
|
||||
}, { deep: true })
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -104,9 +96,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
refineSearch () {
|
||||
this.$refs.tradeService.execSearch()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<div v-if="showStatsBlock && stats.length" class="my-4">
|
||||
<filter-modifier v-for="filter of stats" :key="filter.id"
|
||||
:filter="filter"/>
|
||||
<button @click="applyStats" class="btn w-40 mt-2">Search</button>
|
||||
<button @click="toggleStatsBlock" class="btn w-40 mt-2">Collapse <i class="fas fa-chevron-up pl-1 text-xs text-gray-600"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -74,7 +74,7 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
showStatsBlock: false
|
||||
showStatsBlock: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -84,15 +84,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
toggleStatsBlock () {
|
||||
if (!this.showStatsBlock) {
|
||||
this.showStatsBlock = true
|
||||
} else {
|
||||
this.applyStats()
|
||||
}
|
||||
},
|
||||
applyStats () {
|
||||
this.showStatsBlock = false
|
||||
this.$emit('refine-search')
|
||||
this.showStatsBlock = !this.showStatsBlock
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user