Allow ternary v-bind:type with v-model.
See original GitHub issueWhat problem does this feature solve?
There is common “Show Password” pattern today and we have to use v-if/v-else for that. Can we consider allowing ternary expression that returns only one of text,number,password,search,email,tel,url
allowed in v-bind:type
?
What does the proposed API look like?
<input :type="showPassword ? 'text' : 'password'" v-model="text">
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top Results From Across the Web
How to properly apply ternary operator in v-model in vue.js?
Try this: <input type="text" v-model="$data[testCondition ? 'name' : 'place']">. new Vue({ el: "#app", data: { name: '', place: '' ...
Read more >Ternary into v-model and json - Get Help - Vue Forum
Hi guys, I need some help to do something I would like to use a ternary with json into a v-model but it...
Read more >How to use ternary operator in Vue.js? - Morioh
In this example, we will learn vue.js ternary operator. I will show you how to use ternary ternary with v-model in vuejs. We...
Read more >The chemical bonding topology of ternary and quaternary ...
Abstract: Solid state ternary and quaternary metal nitrides containing a transition metal and one or two very electropositive metals such as alkali and...
Read more >(PDF) V8SiB4 — A new ternary phase in the V–Si–B system
To further examine the stability of V8SiB4, electronic density-of-states (EDOS), phononic density-of-states (PDOS), the chemical bonding and 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 Free
Top 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
I suppose this is supported. https://jsfiddle.net/xujiongbo/phgx2s2o/1/
We will likely support full dynamic type for
v-model
in the next minor release, so closing this one for now.