Commit 17e1fcf15174319f7b1f36ff4d195e22cb3083c4
1 parent
46d4f3b3
init DatePicker
init DatePicker
Showing
11 changed files
with
111 additions
and
5 deletions
Show diff stats
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
src/index.js
... | ... | @@ -12,6 +12,7 @@ import Cascader from './components/cascader'; |
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> | ... | ... |