我正在尝试将dhtmlxscheduler
安装到我的Aurelia CLI(打字稿)应用程序中。我已经安装了它:
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';
答案 0 :(得分:1)
它适用于@Robinson Collado的import语句。您可能希望将dhtmlx-gantt css文件添加为资源:
{
"name": "dhtmlx-gantt",
"path": "../node_modules/dhtmlx-gantt/codebase",
"main": "dhtmlxgantt",
"resources": [
"dhtmlxgantt.css"
]
}
并将其包含在您的模板中:
<require from="dhtmlx-gantt/dhtmlxgantt.css"></require>
答案 1 :(得分:0)