Giter VIP home page Giter VIP logo

many-react-demo's People

Contributors

ckinmind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

many-react-demo's Issues

classnames配和CSS Modules使用问题

之前测试的时候发现classnames配和CSS Modules使用的时候没生效,没有生成hash后缀,开始以为是配和scss出了问题,后来查文档发现是自己使用问题,没写对,如下,完整的使用过程

import classNames from 'classnames/bind';   //问题出在这步,没加bind
import styles from '../index.scss';  //引入scss文件
let cx = classNames.bind(styles); 

//....

     //这里不加单引号也可以,但是我还是习惯加单引号,看着像类名一点
        let liClass = cx({
            'completed': todo.completed,  
            'editing': this.state.editing
        });
        return (
            <li className={liClass}>
                {element}
            </li>
        ) 

关于应用mobx时因为缺少ES7的Decorators支持而报错的问题

在Counter的demo中应用了mobx, 但是开始运行的时候总是报错,报错信息如下

 Decorators are not officially supported yet in 6.x pending a proposal update. 
However, if you need to use them you can install the legacy decorators transform with:

npm install babel-plugin-transform-decorators-legacy --save-dev

and add the following line to your .babelrc file:

{
  "plugins": ["transform-decorators-legacy"]
}

Decorators 装饰者模式是ES7中提案,要支持这个需要安装一个babel-plugin-transform-decorators-legacy 的插件,并且需要修改.babelrc中的配置

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.