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

Not Working Properly on Nuxt #23

Open
halilyuce opened this issue Aug 31, 2021 · 5 comments
Open

Not Working Properly on Nuxt #23

halilyuce opened this issue Aug 31, 2021 · 5 comments

Comments

@halilyuce
Copy link

Hello, thanks for this repo but there is something weird. I added it as a plugin to my project and when I try to use it in the list, It shows only a placeholder.

image

@pggalaviz
Copy link
Owner

@halilyuce looks like you're trying to set the text string directly on the html instead of it being returned from the data in your module. That's why the placeholder is showing there instead of the parsed html.
Check the usage example here: https://pggalaviz.github.io/vue-highlights/#/docs

@halilyuce
Copy link
Author

halilyuce commented Sep 1, 2021

@halilyuce looks like you're trying to set the text string directly on the html instead of it being returned from the data in your module. That's why the placeholder is showing there instead of the parsed html.
Check the usage example here: https://pggalaviz.github.io/vue-highlights/#/docs

Thanks for the reply @pggalaviz but string data is coming from API, I created a loop in a list and I need to use this for every string. Is it possible? I have a timeline like Twitter and I want to parse @mentions, #hashtags and urls in the text thanks to your repo.

@pggalaviz
Copy link
Owner

Thanks for the reply @pggalaviz but string data is coming from API, I created a loop in a list and I need to use this for every string. Is it possible? I have a timeline like Twitter and I want to parse @mentions, #hashtags and urls in the text thanks to your repo.

It's possible to do that, but you shouldn't be passing the text string directly to the v-model since this is a "compuded" value from the data object of your module, you should instead create a separate module as a wrap for the vue-hightlights one and compute your data from there as the example in the documentation.

@halilyuce
Copy link
Author

Thanks for the reply @pggalaviz but string data is coming from API, I created a loop in a list and I need to use this for every string. Is it possible? I have a timeline like Twitter and I want to parse @mentions, #hashtags and urls in the text thanks to your repo.

It's possible to do that, but you shouldn't be passing the text string directly to the v-model since this is a "compuded" value from the data object of your module, you should instead create a separate module as a wrap for the vue-hightlights one and compute your data from there as the example in the documentation.

So, you mean create a child component for this and pass string as prop and use that prop value for v-model, am I right?

@pggalaviz
Copy link
Owner

So, you mean create a child component for this and pass string as prop and use that prop value for v-model, am I right?

Yes, hopefully that solves your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants