未捕获的SyntaxError:导入模块

时间:2016-08-11 11:28:41

标签: javascript typescript ecmascript-6

我有一个typescript文件,将为浏览器编译为javasript。它看起来如下:

/// <reference path="typings/jquery/jquery.d.ts" />
/// <reference path="typings/jquery-backstretch/jquery-backstretch.d.ts" />
/// <reference path="typings/jquery-semantic/jquery-semantic.d.ts" />
import {Validator} from "classes/validator";

var main = () => {
  $(".ui.dropdown").dropdown();
  $(".left-half").backstretch(["../images/lotus.jpg"]);

  const val = new Validator();
  val.foo();

};

$(document)
  .ready(() => {
    main();
  });

编译版本:

/// <reference path="typings/jquery/jquery.d.ts" />
/// <reference path="typings/jquery-backstretch/jquery-backstretch.d.ts" />
/// <reference path="typings/jquery-semantic/jquery-semantic.d.ts" />
import {Validator} from "classes/validator";

var main = () => {
  $(".ui.dropdown").dropdown();
  $(".left-half").backstretch(["../images/lotus.jpg"]);

  const val = new Validator();
  val.foo();

};

$(document)
  .ready(() => {
    main();
  });

当我打电话给网站时,它会显示以下错误:

enter image description here

有什么问题?

0 个答案:

没有答案