Skip to content

基于vue2实现的仿百度日历组件。forked from qiuquanwu

Notifications You must be signed in to change notification settings

vaecebyZ/vue2-calendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-baidu-calendar-vue2

forked from qiuquanwu/vue-baidu-calendar

原项目基于Vue3实现这边为了适应自己的环境,降低成vue2 并且移除antd依赖。 注意!该项目以我自己的需求为第一,并不一定适合您,里面可能存在屎山,pr需谨慎。

安装

npm

$ npm install
$ npm run serve

yarn

$ yarn
$ yarn serve

使用

把/src/componets/BaiduCalendar.vue和Utils直接拷贝到所需要的项目中。

HelloWorld.vue

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

<script>
import baiduCalendar from "./BaiduCalendar";
export default {
  data() {
    return {
      date: "2021-1-27",
      range: [2015,2025],
    };
  },
  components: {
    baiduCalendar,
  },
  methods: {
    change(obj) {
      console.log("obj", obj);
    },
  },
};
</script>

<style>
</style>

演示

About

基于vue2实现的仿百度日历组件。forked from qiuquanwu

Resources

Stars

Watchers

Forks