代码是参照的github上的一个weex阅读器,
照着entry.js打的时候打包运行出现了重复定义的错误,
求大佬看看是代码的问题,或者是版本更新的问题吗?
这个是编译后的其中一个web.js
import App from './App.vue'
import router from './router'
import store from './store'
// import { sync } from 'vuex-router-sync'
import * as filters from './filters'
import mixins from './mixins'
// sync(store, router)
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
})
Vue.mixin(mixins)
new Vue(Vue.util.extend({ el: '#root', router, store }, App))
router.push('/')
const App = require('..\..\src\views\SearchResult.vue');
new Vue(Vue.util.extend({el: '#root'}, App));
调试报错如下:
error in ./.temp/App.web.js
Module build failed: D:/Code/bookreadertwo/.temp/App.web.js: Duplicate declaration "App"
26 | router.push('/')
27 |
> 28 | const App = require('..\src\App.vue');
| ^
29 | new Vue(Vue.util.extend({el: '#root'}, App));
30 |
@ multi (webpack)-dev-server/client?http://192.168.1.4:8081 ./.temp/App.web.js
entry.js的代码如下:
// import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import { sync } from 'vuex-router-sync'
import * as filters from './filters'
import mixins from './mixins'
sync(store, router)
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
})
Vue.mixin(mixins)
new Vue(Vue.util.extend({ el: '#root', router, store }, App))
router.push('/')