chunchao
源码babel配置
{
"presets": [
"@babel/preset-react",
[
"@babel/preset-env",
{
"targets": {
"electron": "4"
},
"modules": false
}
]
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-syntax-async-generators",
"@babel/plugin-syntax-dynamic-import"
]
}
import React from 'react';
import dva from 'dva';
import App from './App';
import demo from '../App/Dva-model/demo.js';
const app = dva();
app.model(demo);
app.router(({ history, app: store }) => (
<App history={history} getState={store._store.getState} dispatch={store._store.dispatch} />
));
app.start('#root');
function vueRender(props) {
new Vue({
router,
store,
render: (h) => h(App),
}).$mount('#test');
}
export default vueRender;
import vueRender from '@v/startVUe.js';
...
componentDidMount() {
vueRender(this.props);
}