Skip to content

Latest commit

 

History

History
72 lines (53 loc) · 1.59 KB

README-en.md

File metadata and controls

72 lines (53 loc) · 1.59 KB

taro-swiper-week



taro-swiper-week is a date picker for taro.
It can be used in many platforms such as H5、mini program!

img

简体中文 | English

🔨 Usage

How to install

npm install taro-swiper-week

Use in page

import SwiperWeek from "taro-swiper-week";
import { View } from "@tarojs/components";
import { useState } from "react";

export default () => {
  const [day, setDay] = useState("2022-08-11");
  const onChange = val => {
    setDay(val);
  };
  return (
    <>
      <SwiperWeek value={day} onChange={onChange} />
      <View>选中日期:{day}</View>
    </>
  );
};

If your environment is H5, you need to modify the configuration items as follows.
Because the unit conversion of taro does not process node_ Modules, the following configuration can help us convert.

// config/index.js
const config = {
  ...
  h5: {
    esnextModules:['taro-swiper-week'],
    ...
  }
  ...
}

🍭 Options

props explain type default
value init value string 今天
hideNickname hide nickname, such as yesterday、 tomorrow boolean true
onChange date selection callback function(value) -

🤝 thanks

If this project is helpful to you, please click a Star