inject ssrContext into createRouter and createStore

This commit is contained in:
jason 2018-02-14 01:45:37 +08:00
parent 4a5aa48b44
commit 65b8148a3d

View File

@ -44,10 +44,10 @@ const defaultTransition = <%=
%>
async function createApp (ssrContext) {
const router = createRouter()
const router = createRouter(ssrContext)
<% if (store) { %>
const store = createStore()
const store = createStore(ssrContext)
// Add this.$router into store actions/mutations
store.$router = router
<% } %>