Skip to content

qiuquanwu/vue-baidu-calendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Feb 6, 2021
82a4ace · Feb 6, 2021

History

16 Commits
Feb 6, 2021
Jan 31, 2021
Feb 6, 2021
Aug 14, 2020
Aug 14, 2020
Jan 28, 2021
Dec 24, 2020
Jan 31, 2021
Aug 14, 2020
Feb 6, 2021
Feb 4, 2021
Jan 31, 2021

Repository files navigation

vue-baidu-calendar

基于vue3实现的百度日历组件。宜忌算法尚未实现,欢迎pr。

react版本github

安装

$ npm install vue-baidu-calendar --save

使用

mian.js

import { createApp } from 'vue'
import App from './App.vue'
import BaiduCalendar from "vue-baidu-calendar"
const app=createApp(App)
app.use(BaiduCalendar)
app.mount('#app')

App.vue

<template>
<!-- 要给外层div指定合适的宽度 -->
   <div style="width:600px;margin-top:16px;margin-left:16px">
      <baidu-calendar @change="change" :date="date" :range="range"/>
  </div>
</template>

<script setup>
import {  ref } from "vue";
//date改变触发事件
const change = (obj)=>{
  console.log('obj',obj)
}
const date = ref("2021-1-27") //设置日期,若不设置,则默认为今天
const range = [2015,2025] //设置年份范围 默认[2010,2030]

</script>

<style></style>

演示

About

基于vue3实现的仿百度日历组件

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published