1.0.2 • Published 1 year ago

caochenguang-ui v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

横向日历组件

安装命令 npm i caochenguang-ui

项目使用

组件依赖vue 3.2.0以上,vant版本3.6.0以上
import { createApp } from 'vue';
import Vant from 'vant';
import 'vant/lib/index.css';
import CcgUI from "caochenguang-ui";
import 'caochenguang-ui/style.css';//引入样式文件

createApp(App).use(Vant).use(CcgUI).mount('#app')

组件使用


<horizontal-calendar :active="thisDate" @changeDate="setDate" />


接收4个参数Props,提供一个event:changeDate
props type
interface Props {
startDate?: Date;
endDate?: Date;
active?: string;
activeDateArray?: string[];
}
startDate:日历起始时间,默认今天;
endDate:日历结束时间,默认今天之后30天;
active:被选中时间格式:"YYYY-MM-dd",默认今天;
activeDateArray:可以点击的日期,格式:"YYYY-MM-dd","YYYY-MM-dd","YYYY-MM-dd"...,默认空,全部可以点击;


Event
当active日期变化时(点击新日期),触发函数changeDate,回调参数(value:Date)