Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to dynamically assign values to textInput using deep-chat in Vue #316

Open
fypl800 opened this issue Dec 10, 2024 · 1 comment
Open
Assignees
Labels
advice Information how to use/implement the component

Comments

@fypl800
Copy link

fypl800 commented Dec 10, 2024

How to dynamically assign values to textInput using deep-chat in Vue

@OvidijusParsiunas
Copy link
Owner

OvidijusParsiunas commented Dec 10, 2024

Hey @fypl800.

You can use the setPlaceholderText method to change the text input placeholder value.

Here is some example code that you can use to achieve this. Her I have used the onComponentRender event to identify when the component is rendered, however you can change it into a timeout or anything else that you prefer:

  setup() {
    const deepChat = ref(null);
    onMounted(() => {
      if (deepChat.value) {
        deepChat.value.onComponentRender = () => {
          deepChat.value.setPlaceholderText("Your text");
        }
      }
    });
    return {
      deepChat,
    };
  },
};
</script>

<template>
  <deep-chat ref="deepChat" />
</template>

Unfortunately you cannot dynamically change any other textInput object's values.

@OvidijusParsiunas OvidijusParsiunas self-assigned this Dec 10, 2024
@OvidijusParsiunas OvidijusParsiunas added the advice Information how to use/implement the component label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advice Information how to use/implement the component
Projects
None yet
Development

No branches or pull requests

2 participants