Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

v-model does not show the value of the attribute loaded in created() or mounted() #77

Open
LucasS03 opened this issue Apr 10, 2020 · 2 comments

Comments

@LucasS03
Copy link

Value of attribute q not load if alter in created() or mounted(), as in my example:

HTML:

<vue-bootstrap-typeahead
   v-model="q"
   :data="list"
   :serializer="i => i.name"
   placeholder="Choose your bank"
   @hit="selectedItem($event)"
   class="vue-autocomplete">
</vue-bootstrap-typeahead>

JAVASCRIPT:

data() {
   return {
      q: "",
      list: []
   }
},
mounted() {
   this.q = loadValueDatabase();
}

The value of attribute q is altered, but not renderized in v-model

@ttodua
Copy link

ttodua commented Apr 13, 2020

I doubt similar issue has been opened, check there if any update.

@mark-stephen-maduro
Copy link

You can use ref to add loaded value.

<vue-bootstrap-typeahead
ref="typeahead"
v-model="q"
:data="list"
:serializer="i => i.name"
placeholder="Choose your bank"
@hit="selectedItem($event)"
class="vue-autocomplete">

mounted() {
this.$refs.typeahead.inputValue = loadValueDatabase();
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants