【问题标题】:React Kendo UI TreeView throws 'kendo is not defined'React Kendo UI TreeView 抛出“未定义剑道”
【发布时间】:2018-06-01 15:33:17
【问题描述】:

我正在使用 Kendo UI 开发一个 React 项目。我按照Kendo UI TreeView的步骤操作

我已经安装了@progress/kendo-treeview-react-wrapper@progress/kendo-ui,并使用import '@progress/kendo-theme-material/dist/all.css';将主题导入到我的项目中

当我使用 KendoUI 按钮时,一切正常,功能和主题是预期的,但使用时会抛出错误 TreeView

Uncaught ReferenceError: kendo is not defined
    at TreeView.componentDidMount (bundle.js:69556)
    at commitLifeCycles (bundle.js:12471)
    at commitAllLifeCycles (bundle.js:14142)
    at HTMLUnknownElement.callCallback (bundle.js:2787)
    at Object.invokeGuardedCallbackDev (bundle.js:2825)
    at invokeGuardedCallback (bundle.js:2874)
    at commitRoot (bundle.js:14281)
    at completeRoot (bundle.js:15189)
    at performWorkOnRoot (bundle.js:15139)
    at performWork (bundle.js:15057)

bundle.js:12330 The above error occurred in the <TreeView> component:
    in TreeView (created by AssetsStatusTreeView)
    in div (created by AssetsStatusTreeView)
    in AssetsStatusTreeView (created by Connect(AssetsStatusTreeView))
    in Connect(AssetsStatusTreeView) (created by Route)
    in Route
    in Switch
    in Router (created by BrowserRouter)
    in BrowserRouter
    in Provider
Uncaught TypeError: Cannot read property 'call' of undefined
    at TreeView.KendoBaseComponent.componentWillUnmount (bundle.js:69569)
    at callComponentWillUnmountWithTimer (bundle.js:12390)
    at HTMLUnknownElement.callCallback (bundle.js:2787)
    at Object.invokeGuardedCallbackDev (bundle.js:2825)
    at invokeGuardedCallback (bundle.js:2874)
    at safelyCallComponentWillUnmount (bundle.js:12397)
    at commitUnmount (bundle.js:12643)
    at unmountHostComponents (bundle.js:12986)
    at commitDeletion (bundle.js:13016)
    at commitAllHostEffects (bundle.js:14100)

有人可以帮忙吗?谢谢!

【问题讨论】:

    标签: reactjs kendo-ui kendo-treeview


    【解决方案1】:

    Kendo React 的说明是:

    还有一步要做,我们需要明确导入@progress/kendo-ui

    import kendo from '@progress/kendo-ui';
    

    Plunker Examples from KendoUI 帮助我弄清楚。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-08
      • 1970-01-01
      相关资源
      最近更新 更多