GitHub

File tree

  • docs/content/docs/2.components

  • playgrounds/nuxt/app/pages

  • src/runtime/components

Original file line numberDiff line numberDiff line change

@@ -435,7 +435,7 @@ function onSubmit() {

435435

<template #footer>

436436

<UContainer class="pb-4 sm:pb-6">

437437

<UChatPrompt v-model="input" :error="chat.error" @submit="onSubmit">

438-

<UChatPromptSubmit :status="chat.status" @stop="chat.stop" @reload="chat.regenerate" />

438+

<UChatPromptSubmit :status="chat.status" @stop="chat.stop()" @reload="chat.regenerate()" />

439439

</UChatPrompt>

440440

</UContainer>

441441

</template>

Original file line numberDiff line numberDiff line change

@@ -284,7 +284,7 @@ function onSubmit() {

284284

<template #footer>

285285

<UContainer class="pb-4 sm:pb-6">

286286

<UChatPrompt v-model="input" :error="chat.error" @submit="onSubmit">

287-

<UChatPromptSubmit :status="chat.status" @stop="chat.stop" @reload="chat.regenerate" />

287+

<UChatPromptSubmit :status="chat.status" @stop="chat.stop()" @reload="chat.regenerate()" />

288288

</UChatPrompt>

289289

</UContainer>

290290

</template>

Original file line numberDiff line numberDiff line change

@@ -129,7 +129,7 @@ function onSubmit() {

129129

<template #footer>

130130

<UContainer class="pb-4 sm:pb-6">

131131

<UChatPrompt v-model="input" :error="chat.error" @submit="onSubmit">

132-

<UChatPromptSubmit :status="chat.status" @stop="chat.stop" @reload="chat.regenerate" />

132+

<UChatPromptSubmit :status="chat.status" @stop="chat.stop()" @reload="chat.regenerate()" />

133133

</UChatPrompt>

134134

</UContainer>

135135

</template>

Original file line numberDiff line numberDiff line change

@@ -74,7 +74,7 @@ function onSubmit() {

7474

class="sticky bottom-0"

7575

@submit="onSubmit"

7676

>

77-

<UChatPromptSubmit :status="chat.status" @stop="chat.stop" @reload="chat.regenerate" />

77+

<UChatPromptSubmit :status="chat.status" @stop="chat.stop()" @reload="chat.regenerate()" />

7878

</UChatPrompt>

7979

</div>

8080

</template>

Original file line numberDiff line numberDiff line change

@@ -78,8 +78,8 @@ export interface ChatPromptSubmitProps extends Omit<ButtonProps, 'icon' | 'color

7878

}

7979
8080

export interface ChatPromptSubmitEmits {

81-

stop: []

82-

reload: []

81+

stop: [event: MouseEvent]

82+

reload: [event: MouseEvent]

8383

}

8484

</script>

8585

@@ -123,27 +123,27 @@ const statusButtonProps = computed(() => ({

123123

icon: props.submittedIcon || appConfig.ui.icons.stop,

124124

color: props.submittedColor,

125125

variant: props.submittedVariant,

126-

onClick() {

127-

emits('stop')

126+

onClick(e) {

127+

emits('stop', e)

128128

}

129129

},

130130

streaming: {

131131

icon: props.streamingIcon || appConfig.ui.icons.stop,

132132

color: props.streamingColor,

133133

variant: props.streamingVariant,

134-

onClick() {

135-

emits('stop')

134+

onClick(e) {

135+

emits('stop', e)

136136

}

137137

},

138138

error: {

139139

icon: props.errorIcon || appConfig.ui.icons.reload,

140140

color: props.errorColor,

141141

variant: props.errorVariant,

142-

onClick() {

143-

emits('reload')

142+

onClick(e) {

143+

emits('reload', e)

144144

}

145145

}

146-

})[props.status])

146+

} satisfies { [key: string]: ButtonProps })[props.status])

147147
148148

// eslint-disable-next-line vue/no-dupe-keys

149149

const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.chatPromptSubmit || {}) })())

Read the original on github.com ↗