【问题标题】:NativeScript Vue RadAutoCompleteTextView programmatically remove all tokensNativeScript Vue RadAutoCompleteTextView 以编程方式删除所有标记
【发布时间】:2020-11-15 14:31:23
【问题描述】:

有一个 removeAllTokens 方法 here,我已经看到如何从 docs 触发另一个方法,但是它在文档中是针对 angular 的,我不确定如何调用 removeAllTokens 方法。 m 使用 NS-Vue。

我们将不胜感激

【问题讨论】:

    标签: javascript nativescript nativescript-vue nativescript-plugin


    【解决方案1】:

    您可以在自动完成元素上设置一个 id,当您想以编程方式删除所有标记时,只需使用它

    import { Frame } from '@nativescript/core'
    
    const autoCompleteView = Frame.topmost().getViewById('<id of autocomplete view>');
    if (autoCompleteView && typeof autoCompleteView.removeAllTokens === 'function') {
      autoCompleteView.removeAllTokens();
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-27
      相关资源
      最近更新 更多