hl037 / vue-contenteditable

This plugin provides a `<contenteditable/>` element supporting `v-model`. It also provides some (optional) features, like preventing html input / paste or new lines.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to access updated value in parent components?

saileshkush95 opened this issue · comments

Actually I'm new to vue, can please help me to access updated value in parent components so that i can use this value to update in the server.

Here is my code snippets.

      <text-editor
        tag="li"
        v-for="page in getNavLink"
        :key="page.id"
        class="border-4 border-light-blue-500 p-2 m-2 border-opacity-25 flex"
        :value="page.title"
        :noNL="true"
        @focus="focus"
        @returned="updatePage"
        @click="updateId(page.id)"
      >
      </text-editor>

You should use v-model instead of :value, and use it as a usual input tag. At the moment, it seems there is a bug with Vue 3 (I didn't have time yet to port it to Vue 3) as you reported #6

The problem comes from Vue 3 having changed the v-model protocol. I am porting it to vue 3 and typescript, stay tuned :)

Fixed in the latest update