# 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

[](https://github.com/hoythan/Vue-MobCal3)
[](https://www.npmjs.com/package/vue-mobcal3)
[](https://github.com/hoythan/Vue-MobCal3/issues)
[](https://github.com/hoythan/Vue-MobCal3/blob/master/LICENSE)
[](https://www.npmjs.com/package/vue-mobcal3)
### Example
- [CodeSandbox](https://codesandbox.io/p/sandbox/goofy-wiles-8kyyrz?file=%2FREADME.md)

---
### 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
LeftBtn
RightBtn
Title
周{{ week(props.day) }}
今
{{ props.date.getDate() }}
```
```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)