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,949
  • 7
  • 25
  • 45

1 Answers1

0

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

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

Limited to:

<input>
<select>
<textarea>
components
tony19
  • 125,647
  • 18
  • 229
  • 307
webprogrammer
  • 2,393
  • 3
  • 21
  • 27