Skip to content

Commit 6954252

Browse files
committed
'1.5.0'
1 parent 5c090f6 commit 6954252

15 files changed

+554
-2366
lines changed

README.md

+26-32
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# vue-datepicker-simple
22

3-
一款非常简单的基于vue的日期选择器
3+
一款非常简单的vue日期选择组件
44

55

6-
## 可以不看的前言
6+
## Update Log (更新日志
77

8-
分享这款小插件的初衷也是感觉像github和npm这样的平台,面向国人友好的库还是非常少,当初真的是找不到一款合适的日期选择插件,诚然代码是全世界通用,但是一些具体的直接面向用户的组件还是会有语言地域差异。如果你也喜欢这款插件,可以在 [github](https://github.com/dai-siki/vue-datepicker-simple) 点击star,让更多国人可以看到。
9-
10-
11-
## 更新日志
8+
### @1.5.0
9+
- 添加了"时至今日"功能(只能选今天之前)
10+
- 添加了"今天不行"功能(不能选今天)
11+
- 添加了"获取焦点的事件回调"
1212

1313
### @1.4.0
1414
- 兼容[email protected]+(需要引入对应的组件,绑定value语法有不同,参考示例2)
@@ -24,57 +24,54 @@
2424
- 可以自定义日期格式
2525

2626

27-
## demo
28-
29-
简单的示例1([email protected]+) [点我](http://dai-siki.github.io/vue-datepicker-simple/example/demo.html).
30-
31-
简单的示例2([email protected]+) [点我](http://dai-siki.github.io/vue-datepicker-simple/example2/demo.html).
27+
## Demo (示例
28+
Click me([email protected]+) [点我](http://dai-siki.github.io/vue-datepicker-simple/example/demo.html).
29+
Click me([email protected]+) [点我](http://dai-siki.github.io/vue-datepicker-simple/example2/demo.html).
3230

3331

34-
## 截图
35-
32+
## Screenshot (截图
3633
![screenshot](screenshot/01.png)
3734
![screenshot](screenshot/02.png)
3835

36+
## Browser Compatibility (浏览器兼容
37+
IE9+
3938

40-
## 依赖
41-
42-
基于 [email protected]+ 和 [email protected]+ 版本。模块使用es6编写(需babel转译)。
39+
## Env (配置环境
40+
vue + webpack + es6
4341

4442

45-
## 安装
43+
## Install (安装
4644

4745
#### npm
4846

4947
```shell
5048
$ npm install vue-datepicker-simple
5149
```
5250

53-
## 使用
54-
55-
使用方法非常简单,参考示例。源码也很清晰,如果你想支持其他语言或调整样式,大可以自行修改相关文件。如果使用过程中遇到什么问题可以反馈给我,我会尽快修复。
56-
57-
#### 相关参数
51+
## Usage (使用
5852

53+
#### Props (相关参数
5954
| 名称 | 类型 | 默认 | 说明 |
6055
| ----------------- | ----------------- | ---------------- | --------------------------------------------- |
6156
| value | String | today | 要绑定的日期变量,值为空则日期面板初始化今天 |
6257
| field | String | "" | 会给input标签添加name及id |
6358
| format | String | 'yyyy-mm-dd' | 日期格式 |
64-
| forward | Boolean | false | 是否向前看(只能选择今天及以后) |
59+
| forward | Boolean | false | 向前看(只能选择今天及以后) |
60+
| backward | Boolean | false | 时至今日(只能选择今天之前) |
61+
| noToday | Boolean | false | 今天不行(不能选今天) |
6562
| placeholder | String | "" | 你懂的 |
6663

6764

68-
#### 示例([email protected]+)
69-
65+
#### Example (示例 [email protected]+
7066
```html
71-
7267
<div id="app">
7368
<label for="myDate">选择您的新婚之日</label>
7469
<date-picker field="myDate"
7570
placeholder="选择日期"
7671
:value.sync="date"
7772
format="yyyy/mm/dd"
73+
:backward="false"
74+
:no-today="true"
7875
:forward="true"></date-picker>
7976
</div>
8077

@@ -94,19 +91,18 @@ new Vue({
9491
});
9592
9693
</script>
97-
9894
```
9995

100-
#### 示例([email protected]+)
101-
96+
#### Example (示例 [email protected]+
10297
```html
103-
10498
<div id="app">
10599
<label for="myDate">选择您的新婚之日</label>
106100
<date-picker field="myDate"
107101
placeholder="选择日期"
108102
v-model="date"
109103
format="yyyy/mm/dd"
104+
:backward="false"
105+
:no-today="true"
110106
:forward="true"></date-picker>
111107
</div>
112108

@@ -124,7 +120,5 @@ new Vue({
124120
'date-picker': myDatepicker
125121
}
126122
});
127-
128123
</script>
129-
130124
```

build/prod.js

-4
This file was deleted.

datepicker-2-dev.vue renamed to datepicker--2.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="vue-datepicker" @mouseout="endChoice" @mouseover="startMouseOver">
3-
<input type="text" autocomplete="off" disableautocomplete :name="field" :id="field" :value="value" :placeholder="placeholder" @focus="startChoice" @keypress="startChoice" @blur="endChoice" ref="input">
3+
<input type="text" autocomplete="off" disableautocomplete :name="field" :id="field" :value="value" :placeholder="placeholder" @focus="startChoice" @keypress="startChoice" @blur="endChoice" ref="input">
44
<div class="vue-datepicker-panels" v-show="dayPanelIsShow || monthPanelIsShow">
55
<!--日期选择-->
66
<div class="vue-datepicker-panel" v-show="dayPanelIsShow">
@@ -260,8 +260,7 @@ export default {
260260
return false;
261261
}
262262
this.month = m;
263-
this.dayPanelIsShow = true;
264-
this.monthPanelIsShow = false;
263+
this.startChoice();
265264
},
266265
// 样式
267266
classMonth(m) {
@@ -304,6 +303,7 @@ export default {
304303
e.returnValue = false;
305304
}
306305
this.dayPanelIsShow = true;
306+
this.monthPanelIsShow = false;
307307
},
308308
prevMonth() {
309309
let {
@@ -369,12 +369,12 @@ export default {
369369
},
370370
// 立即关闭日期面板
371371
immEndChoice() {
372-
this.isMouseOver = true;
372+
this.isMouseOver = false;
373373
this.dayPanelIsShow = false;
374374
}
375375
}
376376
}
377377
378378
</script>
379379

380-
<style lang="sass" scoped>@import "./scss/datepicker.scss"</style>
380+
<style scoped> @import './datepicker.css'; </style>

0 commit comments

Comments
 (0)