0351d front end linting (#377)
* feat: disable custom script for trial users * after lint fix * frontend linting --------- Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
<template>
|
||||
<transition @leave="onLeave">
|
||||
<div
|
||||
ref="collapsible"
|
||||
v-if="modelValue"
|
||||
ref="collapsible"
|
||||
v-on-click-outside.bubble="onClickAway"
|
||||
>
|
||||
<slot/>
|
||||
<slot />
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {vOnClickOutside} from '@vueuse/components'
|
||||
import { vOnClickOutside } from "@vueuse/components"
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {type: Boolean},
|
||||
maxHeight: {type: Number, default: 200},
|
||||
modelValue: { type: Boolean },
|
||||
maxHeight: { type: Number, default: 200 },
|
||||
})
|
||||
const emit = defineEmits(['click-away'])
|
||||
const emit = defineEmits(["click-away"])
|
||||
|
||||
const motion = ref(null)
|
||||
const collapsible = ref(null)
|
||||
@@ -25,28 +25,31 @@ const variants = {
|
||||
initial: {
|
||||
opacity: 0,
|
||||
y: -10,
|
||||
transition: {duration: 75, ease: 'easeIn'}
|
||||
transition: { duration: 75, ease: "easeIn" },
|
||||
},
|
||||
enter: {
|
||||
opacity: 1,
|
||||
y: 0,
|
||||
transition: {duration: 150, ease: 'easeOut'}
|
||||
}
|
||||
transition: { duration: 150, ease: "easeOut" },
|
||||
},
|
||||
}
|
||||
|
||||
watch(() => props.modelValue, (newValue) => {
|
||||
if (newValue) {
|
||||
nextTick(() => {
|
||||
motion.value = useMotion(collapsible.value, variants)
|
||||
})
|
||||
}
|
||||
})
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(newValue) => {
|
||||
if (newValue) {
|
||||
nextTick(() => {
|
||||
motion.value = useMotion(collapsible.value, variants)
|
||||
})
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
const onLeave = (el, done) => {
|
||||
motion.value.leave(done)
|
||||
}
|
||||
|
||||
const onClickAway = (event) => {
|
||||
emit('click-away', event)
|
||||
emit("click-away", event)
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user