Commit 9e4b6e8ec346c65cb14023d5290f7f93d1b63359
1 parent
75ef8633
Time support String
Showing
2 changed files
with
4 additions
and
2 deletions
Show diff stats
examples/routers/time.vue
src/components/time/time.vue
... | ... | @@ -13,7 +13,7 @@ |
13 | 13 | name: 'Time', |
14 | 14 | props: { |
15 | 15 | time: { |
16 | - type: [Number, Date], | |
16 | + type: [Number, Date, String], | |
17 | 17 | required: true |
18 | 18 | }, |
19 | 19 | type: { |
... | ... | @@ -60,6 +60,8 @@ |
60 | 60 | time = (new Date(timestamp)).getTime(); |
61 | 61 | } else if (type === 'object') { |
62 | 62 | time = this.time.getTime(); |
63 | + } else if (type === 'string') { | |
64 | + time = (new Date(this.time)).getTime(); | |
63 | 65 | } |
64 | 66 | |
65 | 67 | if (this.type === 'relative') { | ... | ... |