【问题标题】:Can't bind to 'kendoDropDownTreeHierarchyBinding' since it isn't a known property of 'kendo-dropdowntree'无法绑定到“kendoDropDownTreeHierarchyBinding”,因为它不是“kendo-dropdowntree”的已知属性
【发布时间】:2021-04-23 06:37:18
【问题描述】:

我正在使用kendo-dropdowntree 来实现向下的树视图。我已经在app.module.ts 中导入了组件,但错误似乎并没有消失。可能是什么问题?

app.module.ts

...
import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
...
@NgModule({
  imports: [
   ...
    DropDownsModule 
   ...
  ]
})

feature.component.html

<kendo-dropdowntree kendoDropDownTreeExpandable
                              [kendoDropDownTreeHierarchyBinding]="data"
                              [textField]="'text'"
                              [valueField]="'id'"
                              [childrenField]="'items'">
</kendo-dropdowntree>

feature.component.ts

public data: any[] = [
    {
      text: 'Furniture', id: 1, items: [
        { text: 'Tables & Chairs', id: 2 },
        { text: 'Sofas', id: 3 },
        { text: 'Occasional Furniture', id: 4 }
      ]
    },
    {
      text: 'Decor', id: 5, items: [
        { text: 'Bed Linen', id: 6 },
        { text: 'Carpets', id: 7 }
      ]
    }
  ];

这是错误:

【问题讨论】:

    标签: angular kendo-ui kendo-dropdown


    【解决方案1】:

    正如我测试的那样,您似乎必须将 "@progress/kendo-angular-dropdowns": "5.5.0" 添加到package.json 文件并执行npm install 并运行。它有效。

    如果您使用的是旧版本的 "@progress/kendo-angular-dropdowns": "5.5.0",那么kendoDropDownTreeHierarchyBinding 不起作用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-21
      • 2017-02-03
      • 1970-01-01
      • 2019-10-10
      • 1970-01-01
      • 1970-01-01
      • 2019-08-26
      • 2017-09-17
      相关资源
      最近更新 更多