diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-11 00:08:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-11 00:08:21 +0300 |
commit | e43574ee831197b604c59b80f94e30764223e5ed (patch) | |
tree | f467f4c23cd9d151b5d54711451252de94d62879 /app/assets/javascripts/vue_shared/components/content_transition.vue | |
parent | d18b7dc5eea84db5008986c6879a24ad7f6462a6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/content_transition.vue')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/content_transition.vue | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_shared/components/content_transition.vue b/app/assets/javascripts/vue_shared/components/content_transition.vue new file mode 100644 index 00000000000..446610d6b91 --- /dev/null +++ b/app/assets/javascripts/vue_shared/components/content_transition.vue @@ -0,0 +1,32 @@ +<script> +export default { + props: { + currentSlot: { + type: String, + required: true, + }, + slots: { + type: Array, + required: true, + }, + transitionName: { + type: String, + required: true, + }, + }, + methods: { + shouldShow(key) { + return this.currentSlot === key; + }, + }, +}; +</script> +<template> + <div> + <transition v-for="{ key, attributes } in slots" :key="key" :name="transitionName"> + <div v-show="shouldShow(key)" v-bind="attributes"> + <slot :name="key"></slot> + </div> + </transition> + </div> +</template> |