1.0.28 • Published 2 years ago
vue2-week-calendar v1.0.28
vue2-week-calendar
A Week (years, days) Component For Vue2
Example
Install
$ npm install vue2-week-calendar --save
Usage
<script>
import WeekCalendar from 'vue2-week-calendar';
export default {
components: { WeekCalendar },
data() {
return {
mydate: new Date(),
};
},
};
</script>
<template>
<div>
<WeekCalendar v-model="mydate"></WeekCalendar>
</div>
</template>
Props
Name | Description |
---|---|
month-format | "string" type format (date-fns formats) |
years-format | "string" type format (date-fns formats) |
Css vars
<WeekCalendar class="custom-week-calendar" v-model="mydate"></WeekCalendar>
.custom-week-calendar {
--week-calendar-accent-color: #599455;
--week-calendar-accent-text-color: #f5f5f5;
--week-calendar-border-color: whitesmoke;
--week-calendar-border-active-radius: 8px;
--week-calendar-icon-color: #888;
}
Slots
Name | Description |
---|---|
months | custom months template |
years | custom years template |
days | custom days template |
<WeekCalendar v-model="mydate">
<template v-slot:years="{ years, next, prev, isEqual, change }">
{{ years }}
{{ isEqual(mydate, years[0]) }}
<button @click="prev">Prev</button>
<button @click="next">Next</button>
<button @click="() => change(years[0])">Change 0 index</button>
</template>
<template v-slot:months="{ months, next, prev, isEqual, change }">
{{ months }}
{{ isEqual(mydate, months[0]) }}
<button @click="prev">Prev</button>
<button @click="next">Next</button>
<button @click="() => change(months[0])">Change 0 index</button>
</template>
<template v-slot:days="{ days, next, prev, isEqual, change }">
{{ days }}
{{ isEqual(mydate, days[0]) }}
<button @click="prev">Prev</button>
<button @click="next">Next</button>
<button @click="() => change(days[0])">Change 0 index</button>
</template>
</WeekCalendar>
Dev
Project setup
yarn install
Compiles and hot-reloads for development
yarn serve
Compiles and minifies for production
yarn build
Compiles and minifies for production library
yarn build-lib
Run your unit tests
yarn test:unit
Lints and fixes files
yarn lint
1.0.28
2 years ago
1.0.26
2 years ago
1.0.25
2 years ago
1.0.24
2 years ago
1.0.23
2 years ago
1.0.2-2.1
2 years ago
1.0.22
2 years ago
1.0.21
2 years ago
1.0.20
2 years ago
1.0.19
2 years ago
1.0.18
2 years ago
1.0.16
2 years ago
1.0.15
2 years ago
1.0.14
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago