文档
页面相关
taro
import Taro from '@tarojs/taro';
import React, {} from 'react';
import { View } from '@tarojs/components';
import './index.less';
interface Iindex {}
export default function index(props: Iindex) {
return (
<View className='index'>
</View>
);
}
index.defaultProps = {};
tra
redux相关
import { } from '@redux/constants';
import { } from '@api/';
const testAction = dispatch => {
return {
: async payload => {
const {res={}} = await (payload)
dispatch({
type: ,
payload: res
})
},
}
}
export type testActionType = ReturnType<typeof testAction>;
export default testAction
trr
reducer
import { } from '@redux/constants';
const defaultState = {};
export default function (state = defaultState, action) {
const { type, payload } = action;
switch (type) {
case : {
return {
...state,
: payload || {}
};
}
default:
return state;
}
}
ui 相关
view
or View
<View></View>
text
or Text
<Text></Text>
swiper
<Swiper
className=''
vertical
circular
indicatorDots
autoplay
indicatorColor='#999'
indicatorActiveColor='#333'
>
<SwiperItem>
<View className=''></View>
</SwiperItem>
<SwiperItem>
<View className=''></View>
</SwiperItem>
</Swiper>
scrollview
<ScrollView
className=''
scrollY
scrollWithAnimation
scrollTop={}
style={}
lowerThreshold={}
upperThreshold={}
onScrollToUpper={}
onScroll={}
>
<View style={}></View>
</ScrollView>
hooks 相关
useContext
useReducer
useCallback
useState
useEffect
useSelector
useDispatch
useMemo
useRef