Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>taro-hooks-pluginNew to Visual Studio Code? Get it now.
taro-hooks-plugin

taro-hooks-plugin

bym

|
466 installs
| (1) | Free
taro 插件
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

文档

页面相关

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

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft