基于vuejs+webpack的日期选择插件
2016-11-03 11:37
1641 查看
基于vuejs+webpack环境使用的日期选择插件,希望大家喜欢。
支持单选和多选日期
支持限定开始和结束日期范围选择。
支持小时分钟
需要引入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>
项目地址: https://github.com/jinzhe/vue-calendar
本文已被整理到了《Vue.js前端组件学习教程》,欢迎大家学习阅读。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。
您可能感兴趣的文章:
相关文章推荐
- [js高手之路]Vue2.0基于vue-cli+webpack父子组件通信教程
- [js高手之路]Vue2.0基于vue-cli+webpack同级组件之间的通信教程
- [js高手之路]Vue2.0基于vue-cli+webpack父子组件通信教程
- 基于webpack和vue.js搭建的H5端框架(其实主要用于Hybrid开发H5端框架,但是依然能够作为纯web端使用)
- 详解基于webpack和vue.js搭建开发环境
- 基于webpack和vue.js搭建的H5端框架
- 基于webpack和vue.js搭建开发环境
- [js高手之路]Vue2.0基于vue-cli+webpack Vuex用法详解
- 基于webpack和vue.js搭建开发环境
- 基于vue.js 2.0,不使用webpack,只在浏览器上单独使用Element UI的Table表格控件完成增删改查页面
- 基于webpack和vue.js搭建的H5端框架
- 基于vue.js和webpack的Chat示例
- vue.js环境搭建(基于webpack和vue.js)
- [js高手之路]Vue2.0基于vue-cli+webpack父子组件通信教程
- webpack + vue 项目 自定义 插件 解决 前端 JS 版本 更新 问题
- [js高手之路]Vue2.0基于vue-cli+webpack父子组件通信教程
- 基于vue.js 2.0,不使用webpack的nodejs服务,只在浏览器上单独使用在Element UI的Tree树形控件
- 基于vue.js和webpack的Chat示例
- 基于webpack和vue.js搭建开发环境
- 基于webpack和vue.js搭建开发环境(修改文章列子几个小错误)