Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v-model is not updating the value #65

Open
quantumass opened this issue Jul 19, 2022 · 1 comment
Open

v-model is not updating the value #65

quantumass opened this issue Jul 19, 2022 · 1 comment

Comments

@quantumass
Copy link

Bug

The v-model didn't work the value would disappear after I click on the option, I tried so many things with no success
here is an example
https://codesandbox.io/s/heuristic-cookies-q48ez9

Solution

After banging my head against the wall I discovered that the data should not be computed value
I was doing

<v-selectpage
  v-model="selectedClientId"
  :data="options.map(el => ({
      name: el.name,
      id: String(el.id)
    }))"
  placeholder=" "
  title=" "
/>

I should do

<v-selectpage
  v-model="selectedClientId"
  :data="options"
  key-field="id" 
  show-field="name"
  placeholder=" "
  title=" "
/>
@TerryZ
Copy link
Owner

TerryZ commented Jul 20, 2022

In your examples case, only need to remove .map(...) content

<v-selectpage
  v-model="selectedClientId"
  :data="options"
  placeholder=" "
  title=" "
>
</v-selectpage>

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

No branches or pull requests

2 participants