Assign only value
See original GitHub issueHi, i want assign only the value to a model:
options = [
{value: 'a', label: 'A'}
]
<v-select
:value.sync="selected"
:options="options">
</v-select>
When i select an option, selected is:
selected: {value: 'a', label: 'A'};
I want only this:
selected: 'a';
Whats the problem here or whats the solution?
Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Object.assign() - JavaScript - MDN Web Docs
The Object.assign() method only copies enumerable and own properties from a source object to a target object. It uses [[Get]] on the source...
Read more >javascript - Object.assign, values only
I can write a method which does, but I wanted to see if there was already a solution to this problem first.
Read more >Assign other value to a variable from two possible values
Suppose a variable x can have only two possible values a and b, and you wish to assign to x the value other...
Read more >Assign-once Variables
By saying that Prolog has assign-once variables, I mean that any particular variable in a Prolog procedure can only ever get one value...
Read more >= (assign) / Reference / Processing.org
Assigns a value to a variable. The "=" sign does not mean "equals", but is used to place data within a variable. The...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@NightZpy, as you’ve seen
vue-select
returns the entire object by default, and @gallib solution will work, but you probably need to drop.sync
as well:Sorry for the slow reply, hope you got this sorted out.
Hi,
I had the same problem.
I used the on-change event to resolve it.
my function looks like:
Hope that can help you.