daisy-ui-kit 5.0.0-pre.10 → 5.0.0-pre.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/app/components/Accordion.vue +8 -5
  2. package/app/components/Alert.vue +2 -1
  3. package/app/components/Avatar.vue +10 -7
  4. package/app/components/AvatarGroup.vue +6 -2
  5. package/app/components/Badge.vue +14 -1
  6. package/app/components/Button.vue +60 -45
  7. package/app/components/Calendar.vue +24 -1
  8. package/app/components/CalendarInput.vue +2 -2
  9. package/app/components/CalendarSkeleton.vue +51 -10
  10. package/app/components/Card.vue +15 -2
  11. package/app/components/CardActions.vue +1 -1
  12. package/app/components/CardBody.vue +1 -1
  13. package/app/components/CardTitle.vue +1 -1
  14. package/app/components/Carousel.vue +2 -1
  15. package/app/components/Chat.vue +6 -1
  16. package/app/components/Checkbox.vue +1 -1
  17. package/app/components/Collapse.vue +37 -5
  18. package/app/components/CollapseTitle.vue +11 -1
  19. package/app/components/Countdown.vue +3 -3
  20. package/app/components/CountdownTimers.vue +4 -7
  21. package/app/components/Counter.vue +13 -2
  22. package/app/components/DaisyLink.vue +29 -15
  23. package/app/components/Dock.vue +1 -1
  24. package/app/components/DockItem.vue +1 -1
  25. package/app/components/Drawer.vue +15 -12
  26. package/app/components/DrawerContent.vue +9 -6
  27. package/app/components/DrawerSide.vue +9 -6
  28. package/app/components/Dropdown.vue +61 -50
  29. package/app/components/DropdownButton.vue +11 -4
  30. package/app/components/DropdownContent.vue +90 -19
  31. package/app/components/DropdownTarget.vue +9 -2
  32. package/app/components/Fab.vue +16 -0
  33. package/app/components/FabClose.vue +18 -0
  34. package/app/components/FabMainAction.vue +5 -0
  35. package/app/components/FabTrigger.vue +117 -0
  36. package/app/components/Fieldset.vue +1 -4
  37. package/app/components/FileInput.vue +1 -1
  38. package/app/components/Filter.vue +35 -32
  39. package/app/components/Flex.vue +3 -1
  40. package/app/components/FlexItem.vue +30 -27
  41. package/app/components/Footer.vue +16 -12
  42. package/app/components/FooterTitle.vue +8 -5
  43. package/app/components/Hero.vue +9 -6
  44. package/app/components/HeroContent.vue +9 -6
  45. package/app/components/Hover3D.vue +22 -0
  46. package/app/components/HoverGallery.vue +11 -0
  47. package/app/components/Indicator.vue +8 -5
  48. package/app/components/IndicatorItem.vue +16 -13
  49. package/app/components/Input.vue +47 -40
  50. package/app/components/Kbd.vue +2 -1
  51. package/app/components/Label.vue +32 -29
  52. package/app/components/MenuExpand.vue +1 -7
  53. package/app/components/MenuExpandToggle.vue +7 -1
  54. package/app/components/MenuItem.vue +6 -4
  55. package/app/components/Modal.vue +23 -17
  56. package/app/components/Progress.vue +13 -1
  57. package/app/components/Prose.vue +7 -2
  58. package/app/components/RadialProgress.vue +8 -8
  59. package/app/components/Radio.vue +1 -1
  60. package/app/components/RadioGroup.vue +2 -2
  61. package/app/components/Range.vue +2 -2
  62. package/app/components/RangeMeasure.vue +33 -30
  63. package/app/components/Rating.vue +70 -53
  64. package/app/components/Select.vue +44 -47
  65. package/app/components/SkeletonText.vue +11 -0
  66. package/app/components/Steps.vue +7 -2
  67. package/app/components/Swap.vue +4 -10
  68. package/app/components/Tab.vue +18 -5
  69. package/app/components/Text.vue +42 -22
  70. package/app/components/TextArea.vue +30 -27
  71. package/app/components/TextRotate.vue +24 -0
  72. package/app/components/ThemeController.vue +3 -4
  73. package/app/components/ThemeProvider.vue +47 -32
  74. package/app/components/TimelineLine.vue +1 -1
  75. package/app/components/TimelineStart.vue +2 -1
  76. package/app/components/Toast.vue +1 -6
  77. package/app/components/Toggle.vue +2 -2
  78. package/app/components/Tooltip.vue +2 -1
  79. package/app/utils/drawer-utils.ts +15 -13
  80. package/app/utils/position-area.ts +41 -0
  81. package/package.json +9 -7
@@ -1,29 +1,35 @@
1
1
  <script setup lang="ts">
2
- import { computed, ref, watch } from 'vue';
2
+ import { computed, ref, watch } from 'vue'
3
3
 
4
- const props = withDefaults(defineProps<{
5
- modelValue?: boolean
6
- closeOnClickOutside?: boolean
7
- placement?: 'top' | 'bottom' | 'start' | 'end'
8
- top?: boolean
9
- bottom?: boolean
10
- start?: boolean
11
- end?: boolean
12
- }>(), {
13
- closeOnClickOutside: true,
14
- })
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ modelValue?: boolean
7
+ closeOnClickOutside?: boolean
8
+ placement?: 'top' | 'bottom' | 'start' | 'end'
9
+ top?: boolean
10
+ bottom?: boolean
11
+ start?: boolean
12
+ end?: boolean
13
+ }>(),
14
+ {
15
+ closeOnClickOutside: true,
16
+ },
17
+ )
15
18
  const emit = defineEmits(['update:modelValue'])
16
19
 
17
20
  const is = 'div'
18
21
 
19
22
  // defineModel 'open'
20
23
  const _isOpen = ref(props.modelValue)
21
- watch(() => props.modelValue, (val) => {
22
- _isOpen.value = val
23
- })
24
+ watch(
25
+ () => props.modelValue,
26
+ val => {
27
+ _isOpen.value = val
28
+ },
29
+ )
24
30
  const isOpen = computed({
25
31
  get: () => _isOpen.value,
26
- set: (val) => {
32
+ set: val => {
27
33
  _isOpen.value = val
28
34
  if (props.modelValue !== val) {
29
35
  emit('update:modelValue', val)
@@ -39,7 +45,7 @@ function handleClick() {
39
45
  </script>
40
46
 
41
47
  <template>
42
- <input v-model="isOpen" type="checkbox" class="modal-toggle">
48
+ <input v-model="isOpen" type="checkbox" class="modal-toggle" />
43
49
  <Component
44
50
  :is="is"
45
51
  v-bind="{ ...$attrs, ...$props }"
@@ -1,5 +1,17 @@
1
1
  <script setup lang="ts">
2
- const { value = 0, max = 100, color, neutral, primary, secondary, accent, success, info, warning, error } = defineProps<{
2
+ const {
3
+ value = 0,
4
+ max = 100,
5
+ color,
6
+ neutral,
7
+ primary,
8
+ secondary,
9
+ accent,
10
+ success,
11
+ info,
12
+ warning,
13
+ error,
14
+ } = defineProps<{
3
15
  value?: string | number
4
16
  max?: string | number
5
17
 
@@ -25,8 +25,13 @@
25
25
  @apply text-accent;
26
26
  }
27
27
 
28
- .prose h1 a, .prose h2 a, .prose h3 a, .prose h4 a, .prose h5 a, .prose h6 a {
28
+ .prose h1 a,
29
+ .prose h2 a,
30
+ .prose h3 a,
31
+ .prose h4 a,
32
+ .prose h5 a,
33
+ .prose h6 a {
29
34
  text-decoration: none;
30
- @apply font-bold
35
+ @apply font-bold;
31
36
  }
32
37
  </style>
@@ -20,14 +20,14 @@ defineProps<{
20
20
  <div
21
21
  class="radial-progress"
22
22
  :class="{
23
- 'text-neutral': (neutral || color === 'neutral'),
24
- 'text-primary': (primary || color === 'primary'),
25
- 'text-secondary': (secondary || color === 'secondary'),
26
- 'text-accent': (accent || color === 'accent'),
27
- 'text-info': (info || color === 'info'),
28
- 'text-success': (success || color === 'success'),
29
- 'text-warning': (warning || color === 'warning'),
30
- 'text-error': (error || color === 'error'),
23
+ 'text-neutral': neutral || color === 'neutral',
24
+ 'text-primary': primary || color === 'primary',
25
+ 'text-secondary': secondary || color === 'secondary',
26
+ 'text-accent': accent || color === 'accent',
27
+ 'text-info': info || color === 'info',
28
+ 'text-success': success || color === 'success',
29
+ 'text-warning': warning || color === 'warning',
30
+ 'text-error': error || color === 'error',
31
31
  }"
32
32
  :style="`--value:${value}; --size:${size || '4rem'}; --thickness:${thickness || 'calc(var(--size) / 10)'};`"
33
33
  >
@@ -65,5 +65,5 @@ const currentValue = computed({
65
65
  }"
66
66
  :disabled="props.disabled"
67
67
  :value="props.value"
68
- >
68
+ />
69
69
  </template>
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { computed, provide, reactive } from 'vue';
2
+ import { computed, provide, reactive } from 'vue'
3
3
 
4
4
  const props = defineProps<{
5
5
  modelValue?: any
@@ -28,7 +28,7 @@ const currentValue = computed({
28
28
  get: () => {
29
29
  return props.modelValue
30
30
  },
31
- set: (val) => {
31
+ set: val => {
32
32
  emit('update:modelValue', val)
33
33
  },
34
34
  })
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { computed } from 'vue';
2
+ import { computed } from 'vue'
3
3
 
4
4
  const props = defineProps<{
5
5
  modelValue?: number | string
@@ -57,5 +57,5 @@ const currentValue = computed({
57
57
  :max="max"
58
58
  :step="step"
59
59
  :disabled="disabled"
60
- >
60
+ />
61
61
  </template>
@@ -1,37 +1,40 @@
1
1
  <script setup lang="ts">
2
- import { computed } from 'vue';
2
+ import { computed } from 'vue'
3
3
 
4
- const props = withDefaults(defineProps<{
5
- modelValue?: number | string
6
- min?: number | string
7
- max?: number | string
8
- step?: number | string
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ modelValue?: number | string
7
+ min?: number | string
8
+ max?: number | string
9
+ step?: number | string
9
10
 
10
- numbered?: boolean
11
- asButtons?: boolean
12
- disabled?: boolean
11
+ numbered?: boolean
12
+ asButtons?: boolean
13
+ disabled?: boolean
13
14
 
14
- color?: string
15
- neutral?: boolean
16
- primary?: boolean
17
- secondary?: boolean
18
- accent?: boolean
19
- success?: boolean
20
- warning?: boolean
21
- info?: boolean
22
- error?: boolean
15
+ color?: string
16
+ neutral?: boolean
17
+ primary?: boolean
18
+ secondary?: boolean
19
+ accent?: boolean
20
+ success?: boolean
21
+ warning?: boolean
22
+ info?: boolean
23
+ error?: boolean
23
24
 
24
- size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
25
- xl?: boolean
26
- lg?: boolean
27
- md?: boolean
28
- sm?: boolean
29
- xs?: boolean
30
- }>(), {
31
- min: 0,
32
- max: 100,
33
- step: 1,
34
- })
25
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
26
+ xl?: boolean
27
+ lg?: boolean
28
+ md?: boolean
29
+ sm?: boolean
30
+ xs?: boolean
31
+ }>(),
32
+ {
33
+ min: 0,
34
+ max: 100,
35
+ step: 1,
36
+ },
37
+ )
35
38
  defineEmits(['update:modelValue'])
36
39
 
37
40
  const values = computed(() => {
@@ -76,7 +79,7 @@ const values = computed(() => {
76
79
  :as-button="asButtons"
77
80
  :is-hidden="!tick.isVisible"
78
81
  :disabled="disabled"
79
- @update:model-value="(val) => !disabled && $emit('update:modelValue', val)"
82
+ @update:model-value="val => !disabled && $emit('update:modelValue', val)"
80
83
  >
81
84
  {{ numbered ? tick : '|' }}
82
85
  </RangeMeasureTick>
@@ -1,52 +1,55 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
3
 
4
- const props = withDefaults(defineProps<{
5
- modelValue?: number | string
6
- count?: number | string
7
- half?: boolean
8
-
9
- disabled?: boolean
10
-
11
- color?: string
12
- neutral?: boolean
13
- primary?: boolean
14
- secondary?: boolean
15
- accent?: boolean
16
- info?: boolean
17
- success?: boolean
18
- warning?: boolean
19
- error?: boolean
20
-
21
- bg?: string
22
-
23
- shape?: string
24
- squircle?: boolean
25
- heart?: boolean
26
- hexagon?: boolean
27
- hexagon2?: boolean
28
- decagon?: boolean
29
- pentagon?: boolean
30
- diamond?: boolean
31
- square?: boolean
32
- circle?: boolean
33
-
34
- star?: boolean
35
- star2?: boolean
36
- triangle?: boolean
37
- triangle2?: boolean
38
- triangle3?: boolean
39
- triangle4?: boolean
40
-
41
- size?: 'lg' | 'md' | 'sm' | 'xs' | 'xl'
42
- xl?: boolean
43
- lg?: boolean
44
- md?: boolean
45
- sm?: boolean
46
- xs?: boolean
47
- }>(), {
48
- count: 5,
49
- })
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ modelValue?: number | string
7
+ count?: number | string
8
+ half?: boolean
9
+
10
+ disabled?: boolean
11
+
12
+ color?: string
13
+ neutral?: boolean
14
+ primary?: boolean
15
+ secondary?: boolean
16
+ accent?: boolean
17
+ info?: boolean
18
+ success?: boolean
19
+ warning?: boolean
20
+ error?: boolean
21
+
22
+ bg?: string
23
+
24
+ shape?: string
25
+ squircle?: boolean
26
+ heart?: boolean
27
+ hexagon?: boolean
28
+ hexagon2?: boolean
29
+ decagon?: boolean
30
+ pentagon?: boolean
31
+ diamond?: boolean
32
+ square?: boolean
33
+ circle?: boolean
34
+
35
+ star?: boolean
36
+ star2?: boolean
37
+ triangle?: boolean
38
+ triangle2?: boolean
39
+ triangle3?: boolean
40
+ triangle4?: boolean
41
+
42
+ size?: 'lg' | 'md' | 'sm' | 'xs' | 'xl'
43
+ xl?: boolean
44
+ lg?: boolean
45
+ md?: boolean
46
+ sm?: boolean
47
+ xs?: boolean
48
+ }>(),
49
+ {
50
+ count: 5,
51
+ },
52
+ )
50
53
  const emit = defineEmits(['update:modelValue'])
51
54
 
52
55
  const max = computed(() => Number.parseInt(props.count as string))
@@ -66,10 +69,24 @@ function handleValue(digit: number, half = false) {
66
69
 
67
70
  // Check if any shape prop is set
68
71
  const hasShape = computed(() => {
69
- return props.shape || props.squircle || props.heart || props.hexagon
70
- || props.hexagon2 || props.decagon || props.pentagon || props.diamond
71
- || props.square || props.circle || props.star || props.star2
72
- || props.triangle || props.triangle2 || props.triangle3 || props.triangle4
72
+ return (
73
+ props.shape ||
74
+ props.squircle ||
75
+ props.heart ||
76
+ props.hexagon ||
77
+ props.hexagon2 ||
78
+ props.decagon ||
79
+ props.pentagon ||
80
+ props.diamond ||
81
+ props.square ||
82
+ props.circle ||
83
+ props.star ||
84
+ props.star2 ||
85
+ props.triangle ||
86
+ props.triangle2 ||
87
+ props.triangle3 ||
88
+ props.triangle4
89
+ )
73
90
  })
74
91
  </script>
75
92
 
@@ -93,7 +110,7 @@ const hasShape = computed(() => {
93
110
  class="rating-hidden"
94
111
  :checked="modelValue === 0"
95
112
  @change="$emit('update:modelValue', 0)"
96
- >
113
+ />
97
114
  <template v-for="digit in max" :key="digit">
98
115
  <input
99
116
  type="radio"
@@ -134,7 +151,7 @@ const hasShape = computed(() => {
134
151
  ]"
135
152
  :checked="half ? modelValue === digit - 0.5 : modelValue === digit"
136
153
  @change="() => handleValue(digit, true)"
137
- >
154
+ />
138
155
  <input
139
156
  v-if="half"
140
157
  type="radio"
@@ -174,7 +191,7 @@ const hasShape = computed(() => {
174
191
  ]"
175
192
  :checked="modelValue === digit"
176
193
  @change="() => handleValue(digit)"
177
- >
194
+ />
178
195
  </template>
179
196
  </div>
180
197
  </template>
@@ -1,51 +1,51 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
3
 
4
- type Color = | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'
4
+ type Color = 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'
5
5
 
6
- const props = withDefaults(defineProps<{
7
- modelValue: any
8
- options: Record<string, any>[] | any[]
9
- value?: (val: any) => any
10
- label?: (val: any) => any
11
- resultAsObject?: boolean
12
- join?: boolean
6
+ const props = withDefaults(
7
+ defineProps<{
8
+ modelValue: any
9
+ options: Record<string, any>[] | any[]
10
+ value?: (val: any) => any
11
+ label?: (val: any) => any
12
+ resultAsObject?: boolean
13
+ join?: boolean
13
14
 
14
- ghost?: boolean
15
- disabled?: boolean
16
- validator?: boolean
15
+ ghost?: boolean
16
+ disabled?: boolean
17
+ validator?: boolean
18
+ native?: boolean
17
19
 
18
- color?: Color
19
- primary?: boolean
20
- secondary?: boolean
21
- accent?: boolean
22
- info?: boolean
23
- success?: boolean
24
- warning?: boolean
25
- error?: boolean
20
+ color?: Color
21
+ neutral?: boolean
22
+ primary?: boolean
23
+ secondary?: boolean
24
+ accent?: boolean
25
+ info?: boolean
26
+ success?: boolean
27
+ warning?: boolean
28
+ error?: boolean
26
29
 
27
- size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
28
- xl?: boolean
29
- lg?: boolean
30
- md?: boolean
31
- sm?: boolean
32
- xs?: boolean
33
- }>(), {
34
- value: (val: any) => {
35
- if (!val) {
36
- return null
37
- }
30
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
31
+ xl?: boolean
32
+ lg?: boolean
33
+ md?: boolean
34
+ sm?: boolean
35
+ xs?: boolean
36
+ }>(),
37
+ {
38
+ value: (val: any) => {
39
+ if (!val) {
40
+ return null
41
+ }
38
42
 
39
- return typeof val === 'string'
40
- ? (val as string)
41
- : (val?.value || val?.id || val?._id || val)
43
+ return typeof val === 'string' ? (val as string) : val?.value || val?.id || val?._id || val
44
+ },
45
+ label: (val: any) => (typeof val === 'string' ? (val as string) : val.label || val.name || val.title),
46
+ resultAsObject: false,
42
47
  },
43
- label: (val: any) =>
44
- typeof val === 'string'
45
- ? (val as string)
46
- : (val.label || val.name || val.title),
47
- resultAsObject: false,
48
- })
48
+ )
49
49
  const emit = defineEmits(['update:modelValue'])
50
50
 
51
51
  const computedVModel = computed({
@@ -56,7 +56,7 @@ const computedVModel = computed({
56
56
 
57
57
  return props.modelValue
58
58
  },
59
- set: (val) => {
59
+ set: val => {
60
60
  if (val === undefined) {
61
61
  val = null
62
62
  }
@@ -75,8 +75,10 @@ const computedVModel = computed({
75
75
  class="select"
76
76
  :class="{
77
77
  'join-item': props.join,
78
- 'validator': props.validator,
78
+ validator: props.validator,
79
79
  'select-ghost': props.ghost,
80
+ 'appearance-none': props.native,
81
+ 'select-neutral': props.neutral || props.color === 'neutral',
80
82
  'select-primary': props.primary || props.color === 'primary',
81
83
  'select-secondary': props.secondary || props.color === 'secondary',
82
84
  'select-accent': props.accent || props.color === 'accent',
@@ -92,12 +94,7 @@ const computedVModel = computed({
92
94
  }"
93
95
  :disabled="disabled"
94
96
  >
95
- <option
96
- v-for="option in options"
97
- :key="value(option)"
98
- :value="value(option)"
99
- :disabled="option.disabled"
100
- >
97
+ <option v-for="option in options" :key="value(option)" :value="value(option)" :disabled="option.disabled">
101
98
  {{ label(option) }}
102
99
  </option>
103
100
  </select>
@@ -0,0 +1,11 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{
3
+ is?: any
4
+ }>()
5
+ </script>
6
+
7
+ <template>
8
+ <component :is="props.is || 'span'" class="skeleton skeleton-text">
9
+ <slot />
10
+ </component>
11
+ </template>
@@ -1,5 +1,9 @@
1
1
  <script setup lang="ts">
2
- const { orientation, vertical = false, horizontal = false } = defineProps<{
2
+ const {
3
+ orientation,
4
+ vertical = false,
5
+ horizontal = false,
6
+ } = defineProps<{
3
7
  orientation?: 'vertical' | 'horizontal'
4
8
  vertical?: boolean
5
9
  horizontal?: boolean
@@ -8,7 +12,8 @@ const { orientation, vertical = false, horizontal = false } = defineProps<{
8
12
 
9
13
  <template>
10
14
  <ul
11
- class="steps" :class="{
15
+ class="steps"
16
+ :class="{
12
17
  'steps-vertical': orientation === 'vertical' || vertical,
13
18
  'steps-horizontal': orientation === 'horizontal' || horizontal,
14
19
  }"
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { nextTick, ref, watch } from 'vue';
2
+ import { nextTick, ref, watch } from 'vue'
3
3
 
4
4
  const props = defineProps<{
5
5
  modelValue?: boolean | null
@@ -13,7 +13,7 @@ const checkbox = ref<HTMLInputElement | null>(null)
13
13
  // Keep the checkbox's indeterminate property in sync with modelValue
14
14
  watch(
15
15
  () => props.modelValue,
16
- (val) => {
16
+ val => {
17
17
  nextTick(() => {
18
18
  if (checkbox.value) {
19
19
  checkbox.value.indeterminate = val === null
@@ -28,8 +28,7 @@ function updateValue(event: Event) {
28
28
  // If indeterminate, toggle to checked
29
29
  if (props.modelValue === null) {
30
30
  emit('update:modelValue', true)
31
- }
32
- else {
31
+ } else {
33
32
  emit('update:modelValue', input.checked)
34
33
  }
35
34
  }
@@ -43,12 +42,7 @@ function updateValue(event: Event) {
43
42
  'swap-flip': flip,
44
43
  }"
45
44
  >
46
- <input
47
- ref="checkbox"
48
- type="checkbox"
49
- :checked="modelValue === true"
50
- @change="updateValue"
51
- >
45
+ <input ref="checkbox" type="checkbox" :checked="modelValue === true" @change="updateValue" />
52
46
  <div class="swap-indeterminate">
53
47
  <slot name="indeterminate" />
54
48
  </div>
@@ -1,13 +1,26 @@
1
1
  <script setup lang="ts">
2
- import { inject } from 'vue'
2
+ import { computed, inject } from 'vue'
3
3
 
4
- const { is = 'label', name, ...props } = defineProps<{
5
- is?: any
4
+ const {
5
+ is = 'label',
6
+ name,
7
+ ...props
8
+ } = defineProps<{
9
+ is?: string
6
10
  name?: string
7
11
  active?: boolean
8
12
  disabled?: boolean
9
13
  }>()
10
14
 
15
+ const NuxtLink = resolveComponent('NuxtLink')
16
+ const RouterLink = resolveComponent('RouterLink')
17
+
18
+ const resolvedComponent = computed(() => {
19
+ if (is === 'NuxtLink') return NuxtLink
20
+ if (is === 'RouterLink') return RouterLink
21
+ return is
22
+ })
23
+
11
24
  const tabManager: any = inject('tabManager')
12
25
  if (!tabManager.currentTab.value) {
13
26
  tabManager.currentTab.value = name
@@ -16,7 +29,7 @@ if (!tabManager.currentTab.value) {
16
29
 
17
30
  <template>
18
31
  <component
19
- :is="is"
32
+ :is="resolvedComponent"
20
33
  class="tab"
21
34
  :class="{
22
35
  'tab-active': props.active || tabManager.currentTab.value === name,
@@ -30,7 +43,7 @@ if (!tabManager.currentTab.value) {
30
43
  :value="name"
31
44
  :checked="tabManager.currentTab.value === name"
32
45
  @change="() => (tabManager.currentTab.value = name)"
33
- >
46
+ />
34
47
 
35
48
  <slot v-if="$slots.default" />
36
49
  <span v-else>{{ name }}</span>