2

I'm trying to wrap a TexField ui to a new custom component so that I can add extra functionalities and reuse the component within the project. I want it to still have the v-model binding so I implemented the following:

:text="text" 

and

@textChange="(update)=>{$emit('textChange', update.value)}"

Wherein "text" is its prop named and exposed exactly as a normal TextField prop.

The pattern should work on web but I don't know if it's possible on nativescript vue component. Please have a look at the code I made in playground: https://play.nativescript.org/?template=play-vue&id=Ikap1R&v=1

It's not working. Please help if you know the solution.

Thanks

Kingsley
  • 14,398
  • 5
  • 31
  • 53
Michael Erwin
  • 63
  • 1
  • 6

1 Answers1

3

There is nothing you have to do specifically for {N}, if you know how it works with Vue.js, you got it.

All you have to do is, use a value prop for input value and emit input event on change.

Updated Playground

Manoj
  • 21,753
  • 3
  • 20
  • 41