+7
-13
lines changedFilter options
+7
-13
lines changed Original file line number Diff line number Diff line change
@@ -16,9 +16,11 @@ export default defineComponent({
16
16
let timeoutId = 0;
17
17
const element = ref(null);
18
18
19
-
function toggle(show) {
20
-
clearTimeout(timeoutId);
19
+
function toggle() {
20
+
const show = props.modelValue;
21
21
const el = element.value;
22
+
// console.log('toggle', el, show);
23
+
clearTimeout(timeoutId);
22
24
if (!el) {
23
25
return;
24
26
}
@@ -57,18 +59,10 @@ export default defineComponent({
57
59
}
58
60
}
59
61
60
-
watchEffect(() => {
61
-
toggle(props.modelValue);
62
-
});
63
-
64
-
onMounted(() => {
65
-
addClass(element.value, COLLAPSE);
66
-
if (props.modelValue) {
67
-
addClass(element.value, IN);
68
-
}
69
-
});
62
+
watchEffect(toggle);
70
63
71
-
return () => h(props.tag, { ref: element }, slots.default?.());
64
+
return () =>
65
+
h(props.tag, { ref: element, class: COLLAPSE }, slots.default?.());
72
66
},
73
67
});
74
68
</script>
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4