This repository was archived by the owner on Oct 31, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed
packages/default-theme/src/components/listing/types Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change 2222 </div >
2323</template >
2424<script >
25- import { computed , ref } from " @vue/composition-api"
26-
25+ import { watch , ref } from " @vue/composition-api"
2726import { SfFilter , SfHeading } from " @storefront-ui/vue"
2827import SwInput from " @/components/atoms/SwInput.vue"
2928import useVuelidate from " @vuelidate/core"
30- import { required , email } from " @vuelidate/validators"
3129
3230export default {
3331 components: {
@@ -72,6 +70,19 @@ export default {
7270 value: max .value ,
7371 })
7472 }
73+
74+ watch (() => props .currentFilters [minFilterCode], (v ) => {
75+ if (min .value !== v) {
76+ min .value = v;
77+ }
78+ });
79+
80+ watch (() => props .currentFilters [maxFilterCode], (v ) => {
81+ if (max .value !== v) {
82+ max .value = v;
83+ }
84+ });
85+
7586 return {
7687 min,
7788 max,
Original file line number Diff line number Diff line change 1414 </div >
1515</template >
1616<script >
17- import { computed , ref } from " @vue/composition-api"
18-
1917import { SfFilter , SfHeading } from " @storefront-ui/vue"
2018import SwInput from " @/components/atoms/SwInput.vue"
2119import SwCheckbox from " @/components/atoms/SwCheckbox.vue"
@@ -30,7 +28,7 @@ export default {
3028 },
3129 data () {
3230 return {
33- selected: this .currentFilters [this .filter .code ] === " true" ,
31+ selected: this .currentFilters [this .filter .code ] === true ,
3432 }
3533 },
3634 props: {
@@ -43,6 +41,11 @@ export default {
4341 default : () => ({}),
4442 },
4543 },
44+ watch: {
45+ currentFilters (val ) {
46+ this .selected = val[this .filter .code ] === true ;
47+ },
48+ },
4649}
4750 </script >
4851<style lang="scss" scoped>
You can’t perform that action at this time.
0 commit comments