fritx / vue-at

At.js for Vue.
https://fritx.github.io/vue-at/
MIT License
529 stars 114 forks source link

Need assistance for Events #51

Closed jrvaja closed 6 years ago

jrvaja commented 6 years ago

Hey there,

I much appreciate this repository.

I would love know whether it's support events or not.

Example: If I add any in the text, i need to notify the person. So need the list of all user that I have tagged. As well as, if i remove then it should remove from selected list of tagged user.

Your response is really valuable to me.

Best Regards, Jaimin

Brimstedt commented 6 years ago

Right now im using the functionality of #54, and after the text is "committed" I extract the mentions using regex. It's not the most perfect solution, but works until we have a better one.

So I use:

<span slot="embeddedItem" slot-scope="item">
              <span :data-id="item.current._id" class="tag">{{ item.current.firstName }} {{ item.current.lastName }}</span>
            </span>

And then var regex = RegExp('<span[^>]*data-id="([^"]+)"[^>]*>([^<]+)</span>', 'gi'); (and i sanitize the html before this.)

jrvaja commented 6 years ago

Hey @Brimstedt ,

It works fine! Thank you.

Best Regards, Jaimin