1.5.1 • Published 7 years ago

vue-datepicker-simple v1.5.1

Weekly downloads
10
License
ISC
Repository
github
Last release
7 years ago

vue-datepicker-simple

一款非常简单的vue日期选择组件

Update Log (更新日志

@1.5.0

  • 添加了"时至今日"功能(只能选今天之前)
  • 添加了"今天不行"功能(不能选今天)

@1.4.0

  • 兼容vue@2.0+(需要引入对应的组件,绑定value语法有不同,参考示例2)

@1.3.0

  • 添加了"placeholder"属性

@1.2.0

  • 添加了"向前看"功能(只能选今天及以后)

@1.1.0

  • 添加了年份选择功能
  • 可以自定义日期格式

Demo (示例

vue@1.0+ Click me 点我.

vue@2.0+ Click me 点我.

Screenshot (截图

screenshot screenshot

Browser Compatibility (浏览器兼容

IE9+

Env (配置环境

vue + webpack + es6

Install (安装

npm

$ npm install vue-datepicker-simple

Usage (使用

Props (相关参数

名称类型默认说明
valueStringtoday要绑定的日期变量,值为空则日期面板初始化今天
fieldString""会给input标签添加name及id
formatString'yyyy-mm-dd'日期格式
forwardBooleanfalse向前看(只能选择今天及以后)
backwardBooleanfalse时至今日(只能选择今天之前)
noTodayBooleanfalse今天不行(不能选今天)
placeholderString""你懂的

Example (示例 vue@1.0+

<div id="app">
	<label for="myDate">选择您的新婚之日</label>
	<date-picker field="myDate"
				 placeholder="选择日期"
				 :value.sync="date"
				 format="yyyy/mm/dd"
				 :backward="false"
				 :no-today="true"
				 :forward="true"></date-picker>
</div>

<script>
import 'babel-polyfill'; //因为使用了es6的一些方法,需要babel垫片,如果你项目中已有相关兼容性方案,可忽略
import Vue from 'vue';
import myDatepicker from 'vue-datepicker-simple';

new Vue({
    el: '#app',
    data:{
        date: ''
    },
    components:{
        'date-picker': myDatepicker
    }
});

</script>

Example (示例 vue@2.0+

<div id="app">
	<label for="myDate">选择您的新婚之日</label>
	<date-picker field="myDate"
				 placeholder="选择日期"
				 v-model="date"
				 format="yyyy/mm/dd"
				 :backward="false"
				 :no-today="true"
				 :forward="true"></date-picker>
</div>

<script>
import 'babel-polyfill'; //因为使用了es6的一些方法,需要babel垫片,如果你项目中已有相关兼容性方案,可忽略
import Vue from 'vue';
import myDatepicker from 'vue-datepicker-simple/datepicker-2.vue'; //引入对应的组件

new Vue({
    el: '#app',
    data:{
        date: ''
    },
    components:{
        'date-picker': myDatepicker
    }
});
</script>
1.5.1

7 years ago

1.5.0

7 years ago

1.4.7

7 years ago

1.4.6

7 years ago

1.4.5

7 years ago

1.4.4

7 years ago

1.4.3

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.9

8 years ago

1.2.8

8 years ago

1.2.7

8 years ago

1.2.6

8 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago