Skip to content

Commit

Permalink
feat: add default icon for 'time' type (#583)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngekoding authored Mar 18, 2021
1 parent c558e2f commit e872756
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/date-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { pick, isObject, mergeDeep } from './util/base';
import { getLocale } from './locale';
import Popup from './popup';
import IconCalendar from './icon/icon-calendar';
import IconTime from './icon/icon-time';
import IconClose from './icon/icon-close';
import CalendarPanel from './calendar/calendar-panel';
import CalendarRange from './calendar/calendar-range';
Expand Down Expand Up @@ -465,6 +466,7 @@ export default {
events,
}
);
const calendarIcon = this.type === 'time' ? <IconTime /> : <IconCalendar />;
return (
<div class={`${prefixClass}-input-wrapper`} onMousedown={this.openPopup}>
{input}
Expand All @@ -474,7 +476,7 @@ export default {
</i>
) : null}
<i class={`${prefixClass}-icon-calendar`}>
{this.renderSlot('icon-calendar', <IconCalendar />)}
{this.renderSlot('icon-calendar', calendarIcon)}
</i>
</div>
);
Expand Down
9 changes: 9 additions & 0 deletions src/icon/icon-time.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24px" height="24px">
<path d="M0 0h24v24H0z" fill="none" />
<path
d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
/>
<path d="M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z" />
</svg>
</template>

0 comments on commit e872756

Please sign in to comment.