Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:add #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8,034 changes: 8,034 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -40,4 +40,4 @@
"create:html": "npm run create -- --scope egg-vue-webpack-html-boilerplate",
"create:asset": "npm run create -- --scope egg-vue-webpack-asset-boilerplate"
}
}
}
2 changes: 1 addition & 1 deletion packages/egg-vue-webpack-mpa-boilerplate/package.json
Original file line number Diff line number Diff line change
@@ -88,4 +88,4 @@
"author": "hubcarl@126.com",
"license": "MIT",
"homepage": "https://github.com/easy-team/egg-vue-webpack-boilerplate"
}
}
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
<div
v-for="item in articleList"
:key="item.id"
@click="test"
class="row">
<div class="col-lg-10 col-lg-offset-1 col-md-10 col-md-offset-1">
<div class="post-preview">
@@ -26,6 +27,11 @@
</style>
<script type="text/babel">
export default {
methods: {
test() {
console.log(23333)
}
},
computed: {
isLoading() {
return false;
Original file line number Diff line number Diff line change
@@ -7,14 +7,22 @@ export default class App {
}

bootstrap() {

EASY_ENV_IS_NODE && console.log(EASY_ENV_IS_NODE, new Date())
!EASY_ENV_IS_NODE && console.log(EASY_ENV_IS_NODE, new Date())
// node 代表服务器环境
if (EASY_ENV_IS_NODE) {
return this.server();
}
// 非node 代表客户端环境(浏览器)
// 一套代码,服务端和客户端都会用到,服务端走服务端渲染,客户端走客户端渲染挂载
// 服务端和客户端都要创建各自的vue实例
return this.client();
}

create(initState) {
const { index, options, createStore, createRouter } = this.config;
// 客户端创建的实例state是根据服务端的所维护的state来创建的
const store = createStore(initState, options);
const router = createRouter(initState, options);
sync(store, router);
@@ -70,7 +78,8 @@ export default class App {
).then(() => {
context.state = {
...store.state,
...context.state
...context.state,
test: 'wtf'
};
return resolve(new Vue(options));
});
2 changes: 1 addition & 1 deletion packages/egg-vue-webpack-spa-boilerplate/package.json
Original file line number Diff line number Diff line change
@@ -87,4 +87,4 @@
"author": "hubcarl@126.com",
"license": "MIT",
"homepage": "https://github.com/easy-team/egg-vue-webpack-boilerplate"
}
}