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

添加注册功能 #410

Closed
happypeter opened this issue Mar 3, 2016 · 6 comments
Closed

添加注册功能 #410

happypeter opened this issue Mar 3, 2016 · 6 comments

Comments

@happypeter
Copy link
Owner

目的是要实现收费,课程售卖等功能。把 haoqicat.com 的课程搬过来。

@billie66
Copy link
Collaborator

billie66 commented Mar 3, 2016

好的

@billie66
Copy link
Collaborator

billie66 commented Mar 5, 2016

Radium 可以在 meteor v1.2.1 中使用,直接安装 Radium 的 npm 模块,使用的时候要把组件用 Radium() 方法包裹起来,如下:

TestRadium = Radium(React.createClass({
  render() {
    let styles  = {
      a: {
        display: 'block',
        textDecoration: 'none',
        color: 'gray',
        ':hover': {color: 'red'}
      }
    };
    return (
        <a href='/' style={styles.a}>test radium</a>
    )
  },
}));

测试结果是 Radium 所扩展的功能 :hover 等等,只适用于自定义的组件。若在第三方组件中使用,Radium 的特殊功能就不生效了,需要第三方组件自己支持 Radium 才行。好消息是,material-ui 项目将会采用 Radium 处理组件的 inline style,而抛弃他们自己的方案,相关讨论参考 MUI 的 issue

mui/material-ui#684

@happypeter
Copy link
Owner Author

不过,看来咱们走在正确的方向上

@happypeter
Copy link
Owner Author

Radium 咱们可以稍微用一点,有坑的地方暂时还可以继续用老方法

@billie66
Copy link
Collaborator

billie66 commented Mar 5, 2016

嗯,Radium 对 react-router 的 Link 组件不起作用,不过有解决方案,

const Link = Radium(ReactRouter.Link)

这样,Radium 就生效了。参考 Radium 的 FAQ

https://github.com/FormidableLabs/radium/tree/master/docs/faq

@happypeter
Copy link
Owner Author

帅,Radium 知识我都会总结到课程中的

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

No branches or pull requests

2 participants