我有以下ECMA 6课程并使用vuejs在npm上工作:
import * as globalTypes from 'aaa/src/store/global/mutation-types.js'
import store from 'aaa/src/store/global/index.js'
import axios from 'axios'
import LoginService from './login.service.js'
const loginService = new LoginService()
export default class RestService {
constructor () {
this.lockScreenIfNeeded = function (lockScreen) {
//
}
this.unlockScreenIfNeeded = function () {
//
}
}
}
在构建过程中,
npm run build
我为这个类收到以下错误:
ERROR in static/js/vendor.61bb6545b80ac2f32bac.js from UglifyJs
Unexpected token: name (RestService) [static/js/vendor.61bb6545b80ac2f32bac.js:10168,6]
这个类定义有什么问题?或者在构建vue项目之前是否应该采取一些额外的步骤以避免此类错误?