【问题标题】:Using Nativescript RadDataForm: Property 'telerik' does not exist on type 'typeof com'使用 Nativescript RadDataForm:“typeof com”类型上不存在属性“telerik”
【发布时间】:2020-07-28 09:27:36
【问题描述】:

我正在尝试将高级样式应用于 RadDataForm 的 UIStepper 和 SegmentedBar。我一直在查看the examples,我可以在本地运行这些示例。在我自己的应用程序中尝试实现它时,我得到了一些错误。

ERROR in src/app/round/new/new.component.style.ts:53:44 - error TS2339: Property 'telerik' does not exist on type 'typeof com'.

53         editor.setCustomizeButtons(new com.telerik.android.common.Procedure({
                                              ~~~~~~~
src/app/round/new/new.component.style.ts:75:37 - error TS2304: Cannot find name 'TKGridLayoutAlignment'.

75         editorView.labelAlignment = TKGridLayoutAlignment.Left;
                                       ~~~~~~~~~~~~~~~~~~~~~

环顾四周时,我在使用TKGridLayoutAlignment 时发现了这个other Stack Overflow issue,只需将其声明为变量即可消除错误。我可以使用相同的方法来消除该错误,但我仍然要解决 Property 'telerik' does not exist on type 'typeof com'

我已尝试查看示例中的 tsconfigs 和 package.json,但我无法弄清楚我需要做什么。

我需要哪些配置/包才能实现高级样式?

【问题讨论】:

    标签: nativescript-angular nativescript-telerik-ui


    【解决方案1】:

    reference.d.ts 文件似乎缺少数据表单依赖项,仅包含 android 和 ios 引用。

    目前 reference.d.ts 对我来说应该是这样的:

    /// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
    /// <reference path="./node_modules/tns-platform-declarations/android.d.ts" />
    /// <reference path="./node_modules/nativescript-ui-core/ios.d.ts" />
    /// <reference path="./node_modules/nativescript-ui-core/android.d.ts" />
    /// <reference path="./node_modules/nativescript-ui-autocomplete/ios.d.ts" />
    /// <reference path="./node_modules/nativescript-ui-autocomplete/android.d.ts" />
    /// <reference path="./node_modules/nativescript-ui-dataform/ios.d.ts" />
    /// <reference path="./node_modules/nativescript-ui-dataform/android.d.ts" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-09
      • 1970-01-01
      • 2020-10-04
      • 2020-08-19
      • 2017-11-06
      • 2018-11-09
      • 2018-04-26
      • 1970-01-01
      相关资源
      最近更新 更多