Skip to content

feat: Optimize ts definition with vue and make botname changeable. #4

@DSYZayn

Description

@DSYZayn

Hi there😊
I noticed this great project for building a simple and strong chat web application, but during the usage I found some issues which is mentioned in #3 . I've optimized the ts definition by using setup lang='ts' sugar syntax and defineProps api. Except the origin five files in vue version, I add a type file named message to define the single message in chatdata. Next I wish the definition of message may have more detail like message<T extends 'chatbot' | 'person'> which is I'm using outside of the component now. By the way, I've fixed the scroll behavior to adapt my stream response from the server, now it can always scroll to the right position.
However, though I optimized these problems, I won't pull a request directly because this project is a little complicated for me especially the structure for build three version at one time. So I publish a new npm package https://www.npmjs.com/package/@heyzayn/components and the corresponding source code at https://github.com/DSYZayn/components/tree/main/packages/ChatUI
Wish you can benefit from it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions