aureliaで簡単にdatepickerを動作させようとしていますが、ここでは基本的なことを忘れてしまったと思います。WebpackでAureliaを使用しているときに 'jquery-ui'モジュールが見つからない
イムは、ここに
https://github.com/aurelia/skeleton-navigation/tree/master/skeleton-typescript-webpack
この後のWebPACKでオーレリア骨格を使用して、私は隣にあり、そのインストールのjQuery-UIを前提としています。ここで探し
http://ilikekillnerds.com/2016/02/using-jquery-ui-widgets-in-aurelia/
それはすべて簡単なようです。しかし、関係なく、私は何をすべきか私は、モジュールが正しく動作して取得する方法を見つけ出すカントこの行
import { datepicker } from "jquery-ui";
の「モジュールのjqueryの-UI」を見つけることができません[TS]」 を得続けるん。
npm install jquery
npm install jquery-ui
tsd install jquery
tsd install jqueryui
ここに他に何かがありませんか?
私はwebpackを使っているので、jspmの魔法は必要ありませんか?それとも私は思った?
編集:
npm install jquery-ui --save
は私が必要とするすべてであるように Adding a module dependency in Aurelia with Webpack
ここに見えます。それでも同じ問題
編集:jqueryの-UIは何もエクスポートしませんので、完全なdatepicker.tsコード
import { customElement, bindable, inject } from "aurelia-framework";
import "jquery";
import { datepicker } from "jquery-ui";
@customElement('jquery-ui-datepicker')
@inject(Element)
export class JqueryUiDatepicker {
@bindable id = '';
@bindable name = '';
@bindable options = {};
constructor(Element) {
this.element = Element;
if (!this.id && this.name) {
this.id = this.name;
}
if (!this.name && this.id) {
this.name = this.id;
}
}
attached() {
$(`#${this.id}`).datepicker(this.options)
.on('change', e => {
let changeEvent = new CustomEvent('input', {
detail: {
value: e.val
},
bubbles: true
});
this.element.dispatchEvent(changeEvent);
});
}
detached() {
$(`#${this.id}`).datepicker('destroy').off('change');
}
}
私は問題が何であるかはわかりませんが、tsdが侮辱されているため、タイピングに切り替える価値があるかもしれません。https://github.com/DefinitelyTyped/tsd/issues/269 –
これを見ると、 npm install jquery-uiのあとに "typings install"を実行してください。しかし、同じ結果:/ しかし、私は両方の入力とtsdを持っていました.. tsdを削除し、これが何かを助けるかどうかを確認します。 – Evelie
これを 'jquery-ui/datepicker"からインポートしてみてください。 –