gpt4 book ai didi

typescript - 带有 Aurelia 和 typescript 的 dhtmlxscheduler

转载 作者:搜寻专家 更新时间:2023-10-30 21:12:44 28 4
gpt4 key购买 nike

我正在尝试将 dhtmlxscheduler 安装到我的 Aurelia CLI (typescript) 应用程序中。我已经 npm 安装了它:

npm i dhtmlx-scheduler

然后我将它添加到 aurelia.json 文件中:

{
"name": "dhtmlx-scheduler",
"path": "../node_modules/dhtmlx-scheduler/codebase",
"main": "dhtmlxscheduler"
},

并为它创建全局类型:

typings install dt~dhtmlxscheduler --global --save

所有安装的和 au run 都能正确编译。当我尝试实际使用该库时,尽管出现此错误:

error TS2307: Cannot find module 'dhtmlxscheduler'.
[02:00:15] gulp-notify: [Error running Gulp] Error: src/components/appointments/appointments.ts(2,20): error TS2307: Cannot find module 'dhtmlxscheduler'.

我是这样导入的:

import * as scheduler from 'dhtmlxscheduler';

最佳答案

它与@Robinson Collado 的导入语句一起使用。您可能希望将 dhtmlx-gantt css 文件添加为资源:

{
"name": "dhtmlx-gantt",
"path": "../node_modules/dhtmlx-gantt/codebase",
"main": "dhtmlxgantt",
"resources": [
"dhtmlxgantt.css"
]
}

并将其包含在您的模板中:

<require from="dhtmlx-gantt/dhtmlxgantt.css"></require>

关于typescript - 带有 Aurelia 和 typescript 的 dhtmlxscheduler,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39362315/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com