0
私はAureliaの添付関数でjQueryを使用するように呼び出そうとしています。 jQueryコマンドが実行されるたびに、次のエラーが表示されます。「処理されていない拒否のタイプエラー:jquery_1.defaultは関数ではありません」
未処理の拒否TypeError:jquery_1.defaultは関数ではありません。ここで
は私app.tsコードです:ここで
import {Redirect, NavigationInstruction, RouterConfiguration} from 'aurelia-router';
import 'semantic';
import $ from 'jquery';
export class App {
configureRouter(config: RouterConfiguration): void {
config.title = 'TrackRack';
config.options.hashChange = false;
config.options.root = '/';
config.map([
{ route: ['home'], name: 'home', moduleId: 'views/home' },
{ route: '', name: 'home2', moduleId: 'views/home'}
]);
}
attached() {
$('.nav_menu').visibility({
type: 'fixed'
});
}
}
は私の設定です:
{
"name": "jquery",
"path": "../node_modules/jquery/dist",
"main": "jquery.js"
},
{
"name": "semantic",
"path": "../node_modules/semantic-ui/dist",
"main": "semantic.js",
"resources": [
"semantic.min.css"
]
}
、私が正しく機能するためにすべてのためにこれに私のインポートを変更する必要がありました==>輸入* $から 'jquery' –