Arch1tect
Arch1tect

Reputation: 4281

Pass data to component's textarea in vue.js 2.0

I have a modal component with textarea which I use to edit data that's in my main instance. So the idea is when I open the modal component, the textarea should be showing current data value from the main instance, this can be done by passing data as prop to the modal component. But since it's prop, vue doesn't allow me to edit it in textarea. And if I use v-model for the textarea, how do I get the original data value the moment my modal popup?

Back in 1.x, I just need to add "two-way: true", but this approach depreciated in 2.0.

Upvotes: 0

Views: 1009

Answers (1)

François Romain
François Romain

Reputation: 14393

pass myProp object as a prop and on the text area you pass v-model="myProp.cellModel"

Upvotes: 2

Related Questions