【问题标题】:Property "secure" getting ignored in textfield属性“安全”在文本字段中被忽略
【发布时间】:2018-07-16 13:11:09
【问题描述】:

我目前正在 nativescript/vuejs 中进行一些测试,只是想看看它是如何工作的,以及我是否可以使用它。

经过一个小时的工作,我已经遇到了一个问题,我认为可以在 stackoverflow 上提问。

我正在尝试使用两个文本字段和一个按钮创建一个简单的登录屏幕。 必须保护或“隐藏”一个文本字段,因为您需要在那里填写密码。

在此处找到的文档中:https://nativescript-vue.org/en/docs/elements/components/text-field/ 你可以看到secure属性是专门为这个任务而设计的。

但是在我的文本字段中添加了 secure="true" 之后什么也没发生...

XML:

    <StackLayout class="body" row="0">
        <TextView :hint="usernameHint" editable="true" class="username-textview" v-model="username"/>
        <TextView secure="true" :hint="passwordHint" editable="true" v-model="password"/>
        <button class="btn btn-primary submit-button" @tap="onSubmitButtonPressed" :text="submitText"/>
    </StackLayout>

正如您在下面的结果中看到的那样,没有任何反应......

可能是什么原因,我应该如何处理?

【问题讨论】:

    标签: typescript vue.js nativescript


    【解决方案1】:

    如果您使用 TextField 而不是 TextView,我认为安全是可以访问的。

    【讨论】:

      猜你喜欢
      • 2021-02-16
      • 2016-05-27
      • 2013-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-15
      • 2019-03-27
      • 1970-01-01
      相关资源
      最近更新 更多