Skip to content

Commit

Permalink
Use component with :is
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
  • Loading branch information
raimund-schluessler committed Feb 17, 2023
1 parent a705063 commit 5ea9caa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/components/NcBreadcrumb/NcBreadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ This component is meant to be used inside a Breadcrumbs component.
@dragover.prevent="() => {}"
@dragenter="dragEnter"
@dragleave="dragLeave">
<element :is="tag"
<component :is="tag"
v-if="(title || icon) && !$slots.default"
:exact="exact"
:to="to"
Expand All @@ -51,7 +51,7 @@ This component is meant to be used inside a Breadcrumbs component.
<span v-if="icon" :class="icon" class="icon" />
<span v-else>{{ title }}</span>
</slot>
</element>
</component>
<NcActions v-if="$slots.default"
ref="actions"
type="tertiary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default {
</docs>

<template>
<element :is="wrapperElement"
<component :is="wrapperElement"
:class="{
['checkbox-radio-switch-' + type]: type,
'checkbox-radio-switch--checked': isChecked,
Expand All @@ -171,15 +171,15 @@ export default {
class="checkbox-radio-switch__input"
@change="onToggle">
<NcLoadingIcon v-if="loading" class="checkbox-radio-switch__icon" />
<icon :is="checkboxRadioIconElement"
<component :is="checkboxRadioIconElement"
v-else-if="!buttonVariant"
:size="size"
class="checkbox-radio-switch__icon" />

<!-- @slot The checkbox/radio label -->
<slot />
</label>
</element>
</component>
</template>

<script>
Expand Down
8 changes: 4 additions & 4 deletions src/components/NcUserBubble/NcUserBubble.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ This component has the following slot:

</docs>
<template>
<NcPopover :is="isPopoverComponent"
<component :is="isPopoverComponent"
trigger="hover focus"
:shown="open"
class="user-bubble__wrapper"
@update:open="onOpenChange">
<!-- Main userbubble structure -->
<template #trigger>
<div v-bind="isLinkComponent"
<component v-bind="isLinkComponent"
class="user-bubble__content"
:style="styles.content"
:class="primary ? 'user-bubble__content--primary' : ''"
Expand All @@ -102,12 +102,12 @@ This component has the following slot:
<span v-if="$slots.title" class="user-bubble__secondary">
<slot name="title" />
</span>
</div>
</component>
</template>

<!-- @slot Main Popover content on userbubble hover/focus -->
<slot />
</NcPopover>
</component>
</template>

<script>
Expand Down

0 comments on commit 5ea9caa

Please sign in to comment.