Commit 17e1fcf15174319f7b1f36ff4d195e22cb3083c4

Authored by 梁灏
1 parent 46d4f3b3

init DatePicker

init DatePicker
src/components/date-picker/base/date-table.vue 0 → 100644
  1 +<template>
  2 +
  3 +</template>
  4 +<script>
  5 + export default {
  6 + props: {},
  7 + data () {
  8 + return {}
  9 + },
  10 + computed: {},
  11 + methods: {}
  12 + }
  13 +</script>
0 14 \ No newline at end of file
... ...
src/components/date-picker/base/month-table.vue 0 → 100644
  1 +<template>
  2 +
  3 +</template>
  4 +<script>
  5 + export default {
  6 + props: {},
  7 + data () {
  8 + return {}
  9 + },
  10 + computed: {},
  11 + methods: {}
  12 + }
  13 +</script>
0 14 \ No newline at end of file
... ...
src/components/date-picker/base/year-table.vue 0 → 100644
  1 +<template>
  2 +
  3 +</template>
  4 +<script>
  5 + export default {
  6 + props: {},
  7 + data () {
  8 + return {}
  9 + },
  10 + computed: {},
  11 + methods: {}
  12 + }
  13 +</script>
0 14 \ No newline at end of file
... ...
src/components/date-picker/index.js 0 → 100644
  1 +import DatePicker from './picker/date-picker';
  2 +
  3 +export default DatePicker;
0 4 \ No newline at end of file
... ...
src/components/date-picker/panel/date-range.vue 0 → 100644
  1 +<template>
  2 +
  3 +</template>
  4 +<script>
  5 + export default {
  6 + props: {},
  7 + data () {
  8 + return {}
  9 + },
  10 + computed: {},
  11 + methods: {}
  12 + }
  13 +</script>
0 14 \ No newline at end of file
... ...
src/components/date-picker/panel/date.vue 0 → 100644
  1 +<template>
  2 +
  3 +</template>
  4 +<script>
  5 + export default {
  6 + props: {},
  7 + data () {
  8 + return {}
  9 + },
  10 + computed: {},
  11 + methods: {}
  12 + }
  13 +</script>
0 14 \ No newline at end of file
... ...
src/components/date-picker/picker.vue 0 → 100644
  1 +<template>
  2 +
  3 +</template>
  4 +<script>
  5 + export default {
  6 + props: {},
  7 + data () {
  8 + return {}
  9 + },
  10 + computed: {},
  11 + methods: {}
  12 + }
  13 +</script>
0 14 \ No newline at end of file
... ...
src/components/date-picker/picker/date-picker.js 0 → 100644
  1 +import Picker from '../picker.vue';
  2 +import DatePanel from '../panel/date.vue';
  3 +import DateRangePanel from '../panel/date-range.vue';
  4 +
  5 +const getPanel = function (type) {
  6 + if (type === 'daterange' || type === 'datetimerange') {
  7 + return DateRangePanel;
  8 + }
  9 + return DatePanel;
  10 +};
  11 +
  12 +export default {
  13 + mixins: [Picker],
  14 + props: {
  15 + type: {
  16 + type: String,
  17 + default: 'date'
  18 + }
  19 + },
  20 + created() {
  21 + this.panel = getPanel(this.type);
  22 + }
  23 +}
0 24 \ No newline at end of file
... ...
src/components/input-number/input-number.vue
... ... @@ -37,7 +37,7 @@
37 37 return (/(^-?[0-9]+\.{1}\d+$)|(^-?[1-9][0-9]*$)/).test(value + '');
38 38 }
39 39 function addNum (num1, num2) {
40   - var sq1, sq2, m;
  40 + let sq1, sq2, m;
41 41 try {
42 42 sq1 = num1.toString().split(".")[1].length;
43 43 }
... ...
src/index.js
... ... @@ -12,6 +12,7 @@ import Cascader from &#39;./components/cascader&#39;;
12 12 import Checkbox from './components/checkbox';
13 13 import Circle from './components/circle';
14 14 import Collapse from './components/collapse';
  15 +import DatePicker from './components/date-picker';
15 16 import Dropdown from './components/dropdown';
16 17 import Icon from './components/icon';
17 18 import Input from './components/input';
... ... @@ -52,6 +53,7 @@ const iview = {
52 53 Checkbox,
53 54 CheckboxGroup: Checkbox.Group,
54 55 Circle,
  56 + DatePicker,
55 57 Dropdown,
56 58 DropdownItem: Dropdown.Item,
57 59 DropdownMenu: Dropdown.Menu,
... ...
test/routers/tabs.vue
1 1 <template>
2   - <Tabs size="small">
3   - <Tab-pane label="macOS" icon="social-apple">标签一的内容</Tab-pane>
4   - <Tab-pane label="Windows" icon="social-windows">标签二的内容</Tab-pane>
5   - <Tab-pane label="Linux" icon="social-tux">标签三的内容</Tab-pane>
  2 + <Tabs active-key="key1">
  3 + <tab-pane label="标签一" key="key1">标签一的内容</tab-pane>
  4 + <tab-pane label="标签二" key="key2">标签二的内容</tab-pane>
  5 + <tab-pane label="标签三" key="key3">标签三的内容</tab-pane>
6 6 </Tabs>
7 7 </template>
8 8 <script>
... ...