2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-11 13:52:27 +03:00

feat: add default icon for 'time' type (#583)

This commit is contained in:
Nur Muhammad
2021-03-18 20:16:43 +08:00
committed by GitHub
parent c558e2f507
commit e872756fc3
2 changed files with 12 additions and 1 deletions
+3 -1
View File
@@ -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';
@@ -465,6 +466,7 @@ export default {
events,
}
);
const calendarIcon = this.type === 'time' ? <IconTime /> : <IconCalendar />;
return (
<div class={`${prefixClass}-input-wrapper`} onMousedown={this.openPopup}>
{input}
@@ -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>
);
+9
View File
@@ -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>