用vuejs更改输入类型?

pan*_*hro 2 vue.js vuejs2

我有输入,如何根据条件更改其类型?

<input :type="showInput ? text : hidden">
Run Code Online (Sandbox Code Playgroud)

我已经尝试了上述内容,但类型未呈现。

有任何想法吗?

teb*_*200 7

texthidden变量吗?如果不是,则需要将type的值设置为字符串:

<input :type="showInput ? 'text' : 'hidden'">
Run Code Online (Sandbox Code Playgroud)