Skip to content

Commit 2ed373b

Browse files
committed
refactor(conversation): simplify props
1 parent effb496 commit 2ed373b

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

apps/www/content/3.components/1.chatbot/conversation.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Copy and paste the following code in the same folder.
3434
<script setup lang="ts">
3535
import type { HTMLAttributes } from 'vue'
3636
import { cn } from '@repo/shadcn-vue/lib/utils'
37+
import { reactiveOmit } from '@vueuse/core'
3738
import { StickToBottom } from 'vue-stick-to-bottom'
3839
3940
interface Props {
@@ -55,19 +56,14 @@ const props = withDefaults(defineProps<Props>(), {
5556
mass: 1.25,
5657
anchor: 'none',
5758
})
59+
const delegatedProps = reactiveOmit(props, 'class')
5860
</script>
5961
6062
<template>
6163
<StickToBottom
62-
:aria-label="props.ariaLabel"
64+
v-bind="delegatedProps"
6365
:class="cn('relative flex-1 overflow-y-hidden', props.class)"
6466
role="log"
65-
:initial="props.initial"
66-
:resize="props.resize"
67-
:damping="props.damping"
68-
:stiffness="props.stiffness"
69-
:mass="props.mass"
70-
:anchor="props.anchor"
7167
>
7268
<slot />
7369
</StickToBottom>

packages/elements/src/conversation/Conversation.vue

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import type { HTMLAttributes } from 'vue'
33
import { cn } from '@repo/shadcn-vue/lib/utils'
4+
import { reactiveOmit } from '@vueuse/core'
45
import { StickToBottom } from 'vue-stick-to-bottom'
56
67
interface Props {
@@ -22,19 +23,14 @@ const props = withDefaults(defineProps<Props>(), {
2223
mass: 1.25,
2324
anchor: 'none',
2425
})
26+
const delegatedProps = reactiveOmit(props, 'class')
2527
</script>
2628

2729
<template>
2830
<StickToBottom
29-
:aria-label="props.ariaLabel"
31+
v-bind="delegatedProps"
3032
:class="cn('relative flex-1 overflow-y-hidden', props.class)"
3133
role="log"
32-
:initial="props.initial"
33-
:resize="props.resize"
34-
:damping="props.damping"
35-
:stiffness="props.stiffness"
36-
:mass="props.mass"
37-
:anchor="props.anchor"
3834
>
3935
<slot />
4036
</StickToBottom>

0 commit comments

Comments
 (0)