2ce195a0d4
* refactor(frontend): ♻️ rewrite migrations UI * refactor(backend): ♻️ rewrite recipe migrations * remove vue-demi Co-authored-by: hay-kot <hay-kot@pm.me>
37 lines
No EOL
681 B
Vue
37 lines
No EOL
681 B
Vue
<template>
|
|
<component :is="tag">
|
|
<slot name="activator" v-bind="{ toggle, state }"> </slot>
|
|
<slot v-bind="{ state, toggle }"></slot>
|
|
</component>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent, watch } from "@nuxtjs/composition-api";
|
|
import { useToggle } from "@vueuse/shared";
|
|
|
|
export default defineComponent({
|
|
props: {
|
|
value: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
tag: {
|
|
type: String,
|
|
default: "div",
|
|
},
|
|
},
|
|
setup(_, context) {
|
|
const [state, toggle] = useToggle();
|
|
|
|
watch(state, () => {
|
|
context.emit("input", state);
|
|
});
|
|
|
|
return {
|
|
state,
|
|
toggle,
|
|
};
|
|
},
|
|
});
|
|
</script>
|
|
|