I am trying to access data from a single-file component in Vue, but can't find any way of doing it. I have tried using $emit
, but can't get thath to work either. The data string has to be blank as it gets modified by an input field.
I have seen others' solutions here on SO, but either the don't fit with my problem or I can't get them to work. I want to try to keep it as simple and understandable as possible.
You can use the special attribute ref:
In JS:
Hope this helps!