diff --git a/img/cardParams.png b/img/cardParams.png new file mode 100644 index 0000000000000000000000000000000000000000..bb5c964e730cb02cace8c61656eaf7d0f2ab2e08 Binary files /dev/null and b/img/cardParams.png differ diff --git a/zh-cn/dayJs.md b/zh-cn/dayJs.md index ce936d6b1d46dff396610dc37d2c7333abf8a5f1..ab4bf7446350a4aad5b8778d6dc25923ac66b36d 100644 --- a/zh-cn/dayJs.md +++ b/zh-cn/dayJs.md @@ -26,7 +26,7 @@ npm install dayjs --save #### **yarn** ```bash -yarn dayjs --save +yarn add dayjs --save ``` @@ -339,3 +339,4 @@ dayjs.extend(duration) ## 其他 ## 开源协议 +本项目基于 [The MIT License (MIT)](https://github.com/iamkun/dayjs) ,请自由地享受和参与开源。 diff --git a/zh-cn/react-native-ezswiper.md b/zh-cn/react-native-ezswiper.md new file mode 100644 index 0000000000000000000000000000000000000000..bf8ed8643206e3fc9f992787da0318d4a19b4506 --- /dev/null +++ b/zh-cn/react-native-ezswiper.md @@ -0,0 +1,357 @@ +> 模板版本:v0.1.3 + +

+

react-native-ezswiper

+

+

+ + Supported platforms + + + License + +

+ +> [!tip] +> +> [Github 地址](https://github.com/react-native-oh-library/react-native-ezswiper/tree/sig) + +## 安装与使用 + +进入到工程目录并输入以下命令: + + + +#### **npm** + +```bash +npm install react-native-ezswiper@1.3.0 --save +``` + +#### **yarn** + +```bash +yarn add react-native-ezswiper@1.3.0 --save +``` + + + +下面的代码展示了这个库的基本使用场景: + +```js +/** + * Sample React Native App + * https://github.com/facebook/react-native + * @flow + */ + +import React, { Component } from 'react'; +import { + StyleSheet, + Text, + Button, + View, + Dimensions, + ScrollView, + Image +} from 'react-native'; + +const { width } = Dimensions.get('window'); +import EZSwiper from 'react-native-ezswiper'; + +export default class App extends Component<{}> { + constructor(props) { + super(props) + this.state = { + currentPage: 0, + }; + } + + renderTitle(title) { + return {title} + } + + renderRow(obj, index) { + return ( + + {obj} + + ) + } + + renderImageRow(obj, index) { + return ( + + + {'Victoria\'s Secre ' + index} + + + ) + } + + + onPressRow(obj, index) { + console.log('onPressRow=>obj:' + obj + ' ,index:' + index); + alert('onPressRow=>obj:' + obj + ' ,index:' + index); + } + + onWillChange(obj, index) { + console.log('onWillChange=>obj:' + obj + ' ,index:' + index); + } + + onDidChange(obj, index, setDidChangeObj, setIndex) { + setDidChangeObj(obj); + setIndex(index) + } + + render() { + + return ( + + + + + + + + + + + + + + ); + } +} + + +const DidChangeDom = (props) => { + const [didChangeObj, setDidChangeObj] = React.useState(0); + const [index, setIndex] = React.useState(0); + + return ( + + + obj:{didChangeObj} + index:{index} + + { + setDidChangeObj(obj) + setIndex(index) + }} /> + ) +} + +const WillChangeDom = (props) => { + const [didChangeObj, setDidChangeObj] = React.useState(0); + const [index, setIndex] = React.useState(0); + + return ( + + + obj:{didChangeObj} + index:{index} + + { + setDidChangeObj(obj) + setIndex(index) + }} /> + ) +} + +function ScrollToDom(props) { + this.refDom = null; + const refDomFn = (view) => { + this.refDom = view + } + const scrollTo = (index) => { + if (this.refDom) { + this.refDom.scrollTo(index + 1, true) + } + } + return ( + + +