This commit is contained in:
Julien Nahum
2023-10-24 11:00:54 +02:00
parent d8c0371d43
commit 437644584a
34 changed files with 784 additions and 668 deletions

View File

@@ -15,34 +15,27 @@
</svg>
</div>
</div>
<v-transition>
<VTransition>
<div v-if="showContent" class="w-full">
<slot />
</div>
</v-transition>
</VTransition>
</div>
</template>
<script>
<script setup>
import VTransition from './transitions/VTransition.vue'
import { ref, defineProps, defineEmits } from 'vue'
export default {
name: 'Collapse',
components: { VTransition },
props: {
defaultValue: { type: Boolean, default: false },
value: { type: Boolean, default: null }
},
data () {
return {
showContent: this.value ?? this.defaultValue
}
},
methods: {
trigger () {
this.showContent = !this.showContent
this.$emit('input', this.showContent)
}
}
const props = defineProps({
modelValue: { type: Boolean, default: null }
})
const showContent = ref(props.modelValue)
const emit = defineEmits()
const trigger = () => {
showContent.value = !showContent.value
emit('update:modelValue', showContent.value)
}
</script>

View File

@@ -1,13 +1,12 @@
import Vue from 'vue'
import Dropdown from './Dropdown.vue'
import Card from './Card.vue'
import Button from './Button.vue'
// Components that are registered globaly.
[
Card,
Button,
Dropdown
].forEach(Component => {
Vue.component(Component.name, Component)
})
export function registerComponents (app) {
[
Card,
Button,
Dropdown
].forEach(Component => {
app.component(Component.name, Component)
})
}