0

I'm looking for vuejs solution, for an event when contenteditable is changed. As I understand, v-model is only for the inputs, textarea, and other form inputs.

I tried using v-model and v-html, but as expected, it doesn't change the description(data) whenever I change the content.

<div class="form-control" v-html="description" v-model="description" contenteditable>{{ description }}</div>

Someone knows how to achieve this?

schutte
  • 1,455
  • 5
  • 18
  • 33

1 Answers1

0

v-model doesn't work with div. But you can apply it to a component.

You can check it here https://vuejs.org/v2/api/#v-model

Limited to:

<input>
<select>
<textarea>
components
webprogrammer
  • 2,247
  • 3
  • 16
  • 21