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.

Allow ternary v-bind:type with v-model.

See original GitHub issue

What 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
javoskicommented, Jul 19, 2017

I suppose this is supported. https://jsfiddle.net/xujiongbo/phgx2s2o/1/

0reactions
yyx990803commented, Sep 5, 2017

We will likely support full dynamic type for v-model in the next minor release, so closing this one for now.

Read more comments on GitHub >

github_iconTop 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 >

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