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

egg-view-react #852

Closed
zenjava opened this issue May 5, 2017 · 6 comments
Closed

egg-view-react #852

zenjava opened this issue May 5, 2017 · 6 comments
Assignees

Comments

@zenjava
Copy link

zenjava commented May 5, 2017

  • Node Version:
    v6.9.1
  • Egg Version:
    1.1.0
  • Plugin Name:
    egg-view-react
  • Plugin Version:
    github master
  • Platform:
    osx

配置文件如下:
config/plugins.js

exports.view = {
  enable: true,
  package: 'egg-view-react',
};

config/config.default.js


config.view = {
  };

controller代码

module.exports = app => {
  class HomeController extends app.Controller {

    * index() {
      const dataList = {
        list: [
          { id: 1, title: 'this is news 1', url: '/news/1' },
          { id: 2, title: 'this is news 2', url: '/news/2' },
        ],
      };
      yield this.ctx.render('hello.js', dataList);
    }
  }
  return HomeController;
};

出现错误:
TypeError: this.ctx.render is not a function

@popomore
Copy link
Member

popomore commented May 5, 2017

你这样问无法理解

@popomore
Copy link
Member

popomore commented May 5, 2017

@zenjava
Copy link
Author

zenjava commented May 5, 2017

我改了下,这样能理解了吗

@ngot
Copy link
Member

ngot commented May 5, 2017

#543

#328

@popomore
Copy link
Member

popomore commented May 5, 2017

好像还没完成

@zenjava
Copy link
Author

zenjava commented May 5, 2017

我发现egg-view-react-dom这个组件可以用,有人搞了一个。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants