fritx / vue-at

At.js for Vue.
https://fritx.github.io/vue-at/
MIT License
529 stars 114 forks source link

can not get v-model value #149

Closed 15926524 closed 1 year ago

15926524 commented 1 year ago

Hello, I'm using vue-at with Quasar framework with vue and vue-at versions bellow:

but i cannot get the v-model value with this code:

<template>
  <at :members="members" v-model="atText">
    <div :contenteditable="true"></div>
  </at>
  <at-ta :members="members" v-model="atTaText">
    <textarea v-model="textA"></textarea>
  </at-ta>
  <p>{{ members }}</p>
  <p>{{ atText }}</p>         // ← Never changed TODO:
  <p>{{ atTaText }}</p>       // ← Never changed TODO:
  <p>{{ textA }}</p>          // ← will change TODO:
</template>

<script>
import At from 'vue-at' // for content-editable
import AtTa from 'vue-at/dist/vue-at-textarea' // for textarea

export default {
  components: { At, AtTa },
  data () {
    return {
      members: ['Roxie Miles', 'grace.carroll', 'Allen'],
      atText: "atat",
      atTaText:"tata",
      textA:"textA"
    }
  }
}
</script>

can you give me any suggestions? Thanks!

15926524 commented 1 year ago

I realized I used the wrong syntax. I should have used v-model:value. The corrisponde example is in the branch "wip-vue3", file "app.vue".

ps. can u update the project documentation? I noticed that the project documentation is still the vue2 version, or at least can u mark the version used in the documentation? Thanks!

fritx commented 1 year ago

@15926524 you are right, the current entry of vue3 documentation is not obvious, which needs to be improved.

for Vue3, read this one instead.

image

fritx commented 1 year ago

Also see: https://github.com/fritx/vue-at/issues/148#issuecomment-1508169864

For Quasar q-input, this should work:

<at-ta :members="members">
  <q-input
    v-model="name"
    type="textarea"
    :rows="1"
    :autogrow="false"
    resize="none"
  />
</at-ta>