目前在将 Vue.js-System.js 应用程序移至 webpack2 之前对其进行测试,我遇到了路由模式的问题。
在我的 OPA Memberships 组件中,单击链接时,我想从路由器请求注册页面。我用了
组件/index.js
import Memberships from "components/Memberships/index";
// all the components in the OPA which are not in the routes
....
export {
....
Memberships,
....
}
组件成员资格模板
....
<a type="button" @click="router.go('/registrations')" href="">REGISTRATION</a>
我收到以下错误:
return scope.router.go('/registrations');
Source map error: request failed with status 404
Resource URL: http://127.0.0.1:8080/libs/js/system.js
Source Map URL: system@0.18.17.js.map
如果我删除 href="" 那么我得到
scope.router undefined
在我的 routes/index.js 中,定义了注册路由:
路线/index.js
import Registrations from 'routes/Registrations/index';
export default {
...
'/registrations': {
component: Registrations
},
...
};
和