我有一个 Algolia细化列表,但每次我在它周围切换一个类时,查询都会消失。我无法弄清楚是什么在重置这些值。
这是我当前的示例:
<template>
<div id="app" :class="{active}">
<ais-instant-search :search-client="searchClient" index-name="products">
<button @click="toggleActive">Toggle</button>
<span>← Pressing this is wiping the search.</span>
<div class="dietary-requirements-dropdown--checkboxes">
<ais-refinement-list attribute="dietary" :sort-by="['name:asc']"></ais-refinement-list>
</div>
</ais-instant-search>
</div>
</template>
<script>
import algoliasearch from "algoliasearch/lite";
export default {
name: "App",
data() {
return {
active: false,
searchClient: algoliasearch(
"ZVIJ67X9P8",
"df6c2515326327131df74c0a879b8794"
)
};
},
methods: {
toggleActive() {
this.active = !this.active;
}
}
};
</script>
<style lang="scss">
.dietary-requirements-dropdown--checkboxes {
opacity: 1;
.active & {
opacity: 0.2;
}
}
</style>