GithubHelp home page GithubHelp logo

vue-calendar's Introduction

vue-calendar

基于vuejs+webpack环境使用的日期选择插件,QQ讨论群: 240319632。

  • 支持单选多选日期
  • 支持限定开始结束日期范围选择。
  • 支持小时分钟
  • 需要引入fontawesome.io 的图标库。

Options

  • :show 是否显示
  • :type date|datetime
  • :value 默认值
  • :begin 可选开始时间
  • :end 可选结束时间
  • :x 显示x坐标
  • :y 显示y坐标
  • :range 是否多选

test.vue

<template>
	<input type="text" @click="showCalendar" v-model="value" placeholder="请输入日期">
	<calendar :show.sync="show" :value.sync="value" :x="x" :y="y" :begin="begin" :end="end" :range="range"></calendar>
</template>

<script>
module.exports = {
    data: function() {
        return {
            show:false,
            type:"date", //date datetime
            value:"2015-12-11",
            begin:"2015-12-20",
            end:"2015-12-25",
            x:0,
            y:0,
            range:true,//是否多选
        }
    },
    methods:{
        showCalendar:function(e){
            e.stopPropagation();
            var that=this;
            that.show=true;
            that.x=e.target.offsetLeft;
            that.y=e.target.offsetTop+e.target.offsetHeight+8;
            var bindHide=function(e){
                e.stopPropagation();
                that.show=false;
                document.removeEventListener('click',bindHide,false);
            };
            setTimeout(function(){
                document.addEventListener('click',bindHide,false);
            },500);
        }
    },
    components:{
        calendar: require('./calendar.vue')
    }
}
</script>

vue-calendar's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.