Giter Club home page Giter Club logo

egg-webpack-vue's People

Contributors

hubcarl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

egg-webpack-vue's Issues

兼容Egg2.0

app.view.resolve = function* (name) {
      return name;
    };

导致await app.viewManager.resolve()结果为空对象,导致服务端渲染崩掉。

easy-team/egg-vue-webpack-boilerplate#47

没有阅读其他源码不确定其他部分是否有相关问题。 本地把node_modules中的这句话改为

app.view.resolve = function (name) {
      return name;
    };

能够正常渲染。

文件目录是正确的 但是在读取时拿不到内容是什么原因?

ERROR:

ERROR 18300 [index.js] server render bundle error, try client render, the server render error Error: read webpack memory file[E:\git\nodejs\website\app\web\index.js] content is empty, please check if the file exists

index.js :

import Index from './index.vue'
function serverRender(options) {
console.log(options);
if (options.store && options.router) {
return context => {
options.router.push(context.state.url);
const matchedComponents = options.router.getMatchedComponents();
if (!matchedComponents) {
return Promise.reject({code: '404'});
}
return Promise.all(
matchedComponents.map(component => {
if (component.preFetch) {
return component.preFetch(options.store);
}
return null;
})
).then(() => {
context.state = Object.assign(options.store.state, context.state);
return new Vue(options);
});
};
}
return context => {
const VueApp = Vue.extend(options);
const app = new VueApp({data: context.state});
return new Promise(resolve => {
resolve(app);
});
};
};

export default serverRender({...Index});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.