如何在aurelia jspm

时间:2017-12-01 23:48:35

标签: javascript aurelia systemjs jspm aurelia-cli

我有一个使用jspm的骨架之一的aurelia项目。我试图将nprogress aurelia-cli版本转换为无效。

import * as nprogress from 'nprogress';
import { bindable, noView } from 'aurelia-framework';


@noView()
export class LoadingIndicator {
  @bindable loading = false;

  loadingChanged(newValue) {
    if (newValue) {
      nprogress.start();
    } else {
      nprogress.done();
    }
  }
}

我一直收到此错误

system.src.js:123 Uncaught (in promise) Error: (SystemJS) Invalid or unexpected token
SyntaxError: Invalid or unexpected token
    at eval (<anonymous>)
    at Object.eval (http://localhost:57996/jspm_packages/npm/nprogress@0.2.0.js:1:123)
    at eval (http://localhost:57996/jspm_packages/npm/nprogress@0.2.0.js:2:4)
Evaluating http://localhost:57996/jspm_packages/npm/nprogress@0.2.0/nprogress.css
Evaluating http://localhost:57996/jspm_packages/npm/nprogress@0.2.0.js

加载http://localhost:57996/dist_aurelia/modules/controls/loader/loading-indicator.js

时出错

1 个答案:

答案 0 :(得分:0)

尝试修改导入nprogress。这就是我在我的一个项目中也使用jspm:

    URL GOTO=http://www.iopus.com/imacros/demo/v6/f1/form.asp
SET !LOOP 1  
SET !DATASOURCE out.csv
SET !DATASOURCE_LINE {{!LOOP}}
TAG POS=1 TYPE=TEXTAREA FORM=NAME:TestForm ATTR=NAME:Remarks CONTENT={{!COL1}}