diff --git a/src/components/date-picker/base/date-table.vue b/src/components/date-picker/base/date-table.vue new file mode 100644 index 0000000..f67cf44 --- /dev/null +++ b/src/components/date-picker/base/date-table.vue @@ -0,0 +1,13 @@ + + \ No newline at end of file diff --git a/src/components/date-picker/base/month-table.vue b/src/components/date-picker/base/month-table.vue new file mode 100644 index 0000000..f67cf44 --- /dev/null +++ b/src/components/date-picker/base/month-table.vue @@ -0,0 +1,13 @@ + + \ No newline at end of file diff --git a/src/components/date-picker/base/year-table.vue b/src/components/date-picker/base/year-table.vue new file mode 100644 index 0000000..f67cf44 --- /dev/null +++ b/src/components/date-picker/base/year-table.vue @@ -0,0 +1,13 @@ + + \ No newline at end of file diff --git a/src/components/date-picker/index.js b/src/components/date-picker/index.js new file mode 100644 index 0000000..2f1e3f6 --- /dev/null +++ b/src/components/date-picker/index.js @@ -0,0 +1,3 @@ +import DatePicker from './picker/date-picker'; + +export default DatePicker; \ No newline at end of file diff --git a/src/components/date-picker/panel/date-range.vue b/src/components/date-picker/panel/date-range.vue new file mode 100644 index 0000000..f67cf44 --- /dev/null +++ b/src/components/date-picker/panel/date-range.vue @@ -0,0 +1,13 @@ + + \ No newline at end of file diff --git a/src/components/date-picker/panel/date.vue b/src/components/date-picker/panel/date.vue new file mode 100644 index 0000000..f67cf44 --- /dev/null +++ b/src/components/date-picker/panel/date.vue @@ -0,0 +1,13 @@ + + \ No newline at end of file diff --git a/src/components/date-picker/picker.vue b/src/components/date-picker/picker.vue new file mode 100644 index 0000000..f67cf44 --- /dev/null +++ b/src/components/date-picker/picker.vue @@ -0,0 +1,13 @@ + + \ No newline at end of file diff --git a/src/components/date-picker/picker/date-picker.js b/src/components/date-picker/picker/date-picker.js new file mode 100644 index 0000000..da91ca5 --- /dev/null +++ b/src/components/date-picker/picker/date-picker.js @@ -0,0 +1,23 @@ +import Picker from '../picker.vue'; +import DatePanel from '../panel/date.vue'; +import DateRangePanel from '../panel/date-range.vue'; + +const getPanel = function (type) { + if (type === 'daterange' || type === 'datetimerange') { + return DateRangePanel; + } + return DatePanel; +}; + +export default { + mixins: [Picker], + props: { + type: { + type: String, + default: 'date' + } + }, + created() { + this.panel = getPanel(this.type); + } +} \ No newline at end of file diff --git a/src/components/input-number/input-number.vue b/src/components/input-number/input-number.vue index c1ed19b..20f472e 100644 --- a/src/components/input-number/input-number.vue +++ b/src/components/input-number/input-number.vue @@ -37,7 +37,7 @@ return (/(^-?[0-9]+\.{1}\d+$)|(^-?[1-9][0-9]*$)/).test(value + ''); } function addNum (num1, num2) { - var sq1, sq2, m; + let sq1, sq2, m; try { sq1 = num1.toString().split(".")[1].length; } diff --git a/src/index.js b/src/index.js index 349670d..3d8fe28 100644 --- a/src/index.js +++ b/src/index.js @@ -12,6 +12,7 @@ import Cascader from './components/cascader'; import Checkbox from './components/checkbox'; import Circle from './components/circle'; import Collapse from './components/collapse'; +import DatePicker from './components/date-picker'; import Dropdown from './components/dropdown'; import Icon from './components/icon'; import Input from './components/input'; @@ -52,6 +53,7 @@ const iview = { Checkbox, CheckboxGroup: Checkbox.Group, Circle, + DatePicker, Dropdown, DropdownItem: Dropdown.Item, DropdownMenu: Dropdown.Menu, diff --git a/test/routers/tabs.vue b/test/routers/tabs.vue index 28d984c..ecf028e 100644 --- a/test/routers/tabs.vue +++ b/test/routers/tabs.vue @@ -1,8 +1,8 @@