Sha256: a33a5407a1d79af01770bf6060bad667bd568ef7a5d61c32bb01fd2e6efaffef
Contents?: true
Size: 676 Bytes
Versions: 25
Compression:
Stored size: 676 Bytes
Contents
export default function nav(filterable = true) { return { empty: false, init() { if (filterable) { this.$watch("$store.filter.text", () => this.filter()); this.$nextTick(() => { this.filter(); }); } }, filter() { this.empty = true; this.getChildren().forEach((child) => { const data = Alpine.$data(child); data.filter(this.$store.filter.text); if (!data.hidden) { this.empty = false; } }); }, getChildren() { return this.$refs.items ? Array.from(this.$refs.items.querySelectorAll(":scope > li > div")) : []; }, }; }
Version data entries
25 entries across 25 versions & 1 rubygems