# Vue-MobCal3 **Repository Path**: fire053/Vue-MobCal3 ## Basic Information - **Project Name**: Vue-MobCal3 - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-01-16 - **Last Updated**: 2025-01-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # vue-mobcal3 ![vue](https://img.shields.io/badge/MADE%20WITH-VUE-42a97a?style=for-the-badge&labelColor=35495d) [![GitHub stars](https://img.shields.io/github/stars/hoythan/Vue-MobCal3.svg?style=for-the-badge)](https://github.com/hoythan/Vue-MobCal3) [![npm](https://img.shields.io/npm/v/vue-mobcal3?color=c7343a&label=npm&style=for-the-badge)](https://www.npmjs.com/package/vue-mobcal3) [![GitHub issues](https://img.shields.io/github/issues-raw/hoythan/Vue-MobCal3.svg?style=for-the-badge)](https://github.com/hoythan/Vue-MobCal3/issues) [![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=for-the-badge)](https://github.com/hoythan/Vue-MobCal3/blob/master/LICENSE) [![NPM](https://nodei.co/npm/vue-mobcal3.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/vue-mobcal3) ### Example - [CodeSandbox](https://codesandbox.io/p/sandbox/goofy-wiles-8kyyrz?file=%2FREADME.md) ![image.png](https://i.loli.net/2021/07/21/BXli3sGICa5rcEu.png) --- ### Install ``` bash npm install vue-mobcal3 --save # or yarn add vue-mobcal3 ``` ### Global Registration ``` javascript import Vue from 'vue' import VueMobCal from 'vue-mobcal3' Vue.use(VueMobCal) ``` ### Local Registration ```javascript import { VueMobCal } from 'vue-mobcal3' export default { components: { VueMobCal } } ``` ### Usage #### Basic Usage ```html ``` ```js import { VueMobCal } from 'vue-mobcal3'; import "vue-mobcal3/dist/index.css"; import { ref } from 'vue'; export default { setup() { const currentDate = ref(new Date()); const mode = ref('month'); } } ``` #### Custom Slot ```html ``` ```js import { ref } from 'vue' export default { setup() { const currentDate = ref(new Date()) const mode = ref('month') const week = (day) => { const days = ['一', '二', '三', '四', '五', '六', '日'] day = day || 7 return days[day - 1] } } } ``` ### API #### Props | Attribute | Description | Type | Default | | :----- | :---- | :----: | :---- | | v-model:value | Current calendar date | Date | new Date() | | v-model:mode | Display mode, support monthly or weekly display, params monthweek | String | month | | v-model:color | Theme color | String | #007ad3 | ### Slot | Name | Description | SlotProps | | :----- | :---- | :---- | | title | Custom title | { util: object } | | week | Custom Week Title | { day: number } 0-6 | | left | Custom left icon | - | | right | Custom right icon | - | | day | Custom Calendar Item | { date: date, util: object } | | - util | Common method |
{
 isToday: function,
 isWorkDay: function,
 isOtherMonth: function,
 isActiveDay: function,
 onPrev: function,
 onNext: function,
 onChangeMode: function
}
| ### Event | Event | Description | Arguments | | :----- | :---- | :---- | | onPrev | Change to last month/week | - | | onNext | Change to next month/week | - | | onChange | When the time is selected, it will be triggered and returns the Date() object of the selected time. | - | | onChangeMode | Toggles display mode or set display mode | mode:!string | --- ### CDN ``` html
``` ### Changelog Detailed changes for each release are documented in the [release notes](https://github.com/hoythan/vue-mobcal3/blob/master/CHANGELOG.md). ### License [MIT](https://github.com/hoythan/vue-mobcal3/blob/master/LICENSE)