Giter Site home page Giter Site logo

在访问路由http://172.16.13.183:7001/test 时报下面的错误,其它路由都ok,怎么解决? about egg-vue-webpack-boilerplate HOT 4 CLOSED

DragWeb avatar DragWeb commented on May 12, 2024
在访问路由http://172.16.13.183:7001/test 时报下面的错误,其它路由都ok,怎么解决?

from egg-vue-webpack-boilerplate.

Comments (4)

DragWeb avatar DragWeb commented on May 12, 2024

没有安装 npm install easywebpack-cli -g 导致的

from egg-vue-webpack-boilerplate.

KELEN avatar KELEN commented on May 12, 2024

请问我全局安装了,test还是不能访问怎么解决呢?

from egg-vue-webpack-boilerplate.

KELEN avatar KELEN commented on May 12, 2024

@DragWeb 请问我全局安装了,test还是不能访问怎么解决呢?报的还是 Cannot read property 'render' of undefined

from egg-vue-webpack-boilerplate.

DragWeb avatar DragWeb commented on May 12, 2024

@KELEN 是不是router或者controller写的有问题?下面是我的写法参考下

// router.js
module.exports = app => {
    app.get('/app/doc', 'doc.index')
}
// controller/doc.js
module.exports = app => { 
  return class DocController extends app.Controller {
    * index() {
      const { ctx } = this
      yield ctx.renderClient('doc/doc.js') // 服务端沉浸用render,客户端沉浸用renderClient
    }
  }
}
// app/web/page/doc/doc.js
import App from 'app';
import Layout from 'component/layout/normal';
import Doc from './doc.vue';

App.component(Layout.name, Layout);

export default App.init({
  ...Doc
});

from egg-vue-webpack-boilerplate.

Related Issues (20)

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.