hytstart / taro-sign Goto Github PK
View Code? Open in Web Editor NEWTaro 开发的 思政教育签到小程序
Taro 开发的 思政教育签到小程序
由于小程序的限制,无法遍历 this.props.children, AtTabsPane 需要用户自行传入 current 和 index 参数。
可以用 React.Children.map 来遍历子节点,而不用担心 this.props.children 的数据类型是 undefined 还是 object。
renderProps组件
sourcemap
不能用就很xxxxx**
不能解构传值,需要key value
传给子组件
不能在render
之外写jsx
this.props
传来的函数必须on
或者dispatch
开头
父组件传来的props
,必须定义在static defaultProps
里,要不然获取不到
componentDidMount,在微信/百度/字节跳动/支付宝小程序中这一生命周期方法对应 app 的 onLaunch
componentDidShow在微信/百度/字节跳动/支付宝小程序中这一生命周期方法对应 onShow
componentDidHide在微信/百度/字节跳动/支付宝小程序中这一生命周期方法对应 onHide
JS 代码里必须书写单引号,特别是 JSX 中,如果出现双引号,可能会导致编译错误
环境变量 process.env 的使用,不要以解构的方式来获取通过 env 配置的 process.env 环境变量,请直接以完整书写的方式 process.env.NODE_ENV 来进行使用
使用 this.$componentType 来判断当前 Taro.Component **是页面还是组件,可能取值分别为 PAGE 和 COMPONENT
不支持无状态组件
不能在包含 JSX 元素的 map 循环中使用 if 表达式
不能使用 Array#map 之外的方法操作 JSX 数组
父组件要往子组件传递函数,属性名必须以 on 开头
以上是使用过程中遇到的问题,具体注意事项请查阅https://nervjs.github.io/taro/docs/best-practice.html
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.