question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Writing to the v-model for smart-select component does not effect the component

See original GitHub issue
  • Framework7 version: 3.3.2
  • Vue.js version: 2.5.17
  • Platform and Target: Android

Describe the bug

When I set the v-model of the smart-select component, and I change that variable to an array within my javascript, the list item does not show these items as selected. However, I know it is working because when I then open the smart-select, I can see that those items that I put in the array for the v-model variable are checked, it’s just that they are not showing as selected inside the corresponding list-item button that opens the smart select.

To Reproduce

Steps to reproduce the behavior:

  1. Create smart-select component with a v-model, and the options ‘1’, ‘2’, ‘3’
  2. In your javascript, set the value of the v-model variable to [‘1’]
  3. The smart-select component does not show them as selected unless you open it

Expected behavior

I expect the smart-select component to display the items within it’s v-model variable as selected, even if those items are set as selected within the javascript and not by the user.

Actual Behavior

They are being selected, but they are not being displayed in the list item for the smart-select as they would if the user had selected them manually.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nolimits4webcommented, Oct 1, 2018

I can’t detect changed on <select> by Vue’s v-model. So you need to trigger change event on select after you change it with v-model, like $$('select').trigger('change') or just manually write value text to f7-list-item’s after property

0reactions
BigEEEcommented, Oct 3, 2018

Nice job man. Thanks a million.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Framework7+Vue's smart-select with a v-model
I have something similar... <template> <ul v-if="device.control && device.control.indexOf('effect') !== -1 && device.
Read more >
How Smart, Connected Products Are Transforming Competition
What makes smart, connected products fundamentally different is not the internet, ... Smart components comprise the sensors, microprocessors, data storage, ...
Read more >
Angular Smart Components vs Presentational Components
A Smart Component does not have to be a top level router component only. We can see that there could be other components...
Read more >
mdb-select does not work with v-model and @change event
I have problems using v-model and @change event when using mdb-select. As you can see in the code below I have several mdb-input...
Read more >
Build A Custom Vue Select Component - YouTube
Lets build a pretty looking custom vue select component that replaces the traditional default element element. Lets build it with Vue 3, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found