ckinmind / many-react-demo Goto Github PK
View Code? Open in Web Editor NEW各种react demo的合集,有todo / 计算器 / 动画演示应用等(附详细说明和注释)
Home Page: https://ckinmind.github.io/many-react-demo
各种react demo的合集,有todo / 计算器 / 动画演示应用等(附详细说明和注释)
Home Page: https://ckinmind.github.io/many-react-demo
之前测试的时候发现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>
)
参考资料:
在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中的配置
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.