This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

完成日期选择组件的迁移;更新大量字体图标

old
宇天 2018-01-26 21:36:13 +08:00
parent ec43f4b87d
commit 65524423e8
8 changed files with 31 additions and 16 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -182,6 +182,9 @@
}, },
check: function(val) { check: function(val) {
return Anot.type(val) === this.checkType return Anot.type(val) === this.checkType
},
call: function() {
return this.toString()
} }
} }

View File

@ -237,10 +237,10 @@ export default Anot.component('datepicker', {
}, },
props: { props: {
showTime: false, //对话框上显示时间 showTime: false, //对话框上显示时间
color: 'grey', radius: 3,
format: '', // 日期显示格式 format: '', // 日期显示格式
onCreated: Anot.PropsTypes.isFunction(), onCreated: Anot.PropsTypes.isFunction(),
onDateChange: Anot.PropsTypes.isFunction() onDatePicked: Anot.PropsTypes.isFunction()
}, },
skip: ['max', 'min', 'last', 'timer'], skip: ['max', 'min', 'last', 'timer'],
watch: { watch: {
@ -358,8 +358,8 @@ export default Anot.component('datepicker', {
onConfirm: function() { onConfirm: function() {
this.updateTime() this.updateTime()
this.close() this.close()
if (typeof this.props.onDateChange === 'function') { if (typeof this.props.onDatePicked === 'function') {
this.props.onDateChange(this.value, this.last.pick) this.props.onDatePicked(this.value, this.last.pick)
} }
} }
} }

View File

@ -1,11 +1,16 @@
<div class="do-datepicker do-fn-noselect" :click="cancelBubble"> <div class="do-datepicker do-fn-noselect" :click="cancelBubble">
<input
class="date-input" <label class="date-input">
type="text" <input
:duplex="value" class="input"
:focus="onFocus" type="text"
:attr-placeholder="props.placeholder || '请选择日期'" :duplex="value"
:attr-disabled="disabled"> :focus="onFocus"
:css="{'border-radius': props.radius}"
:attr-placeholder="props.placeholder || '请选择日期'"
:attr-disabled="disabled">
<i class="do-ui-font icon"></i>
</label>
<dl <dl
class="calendar-box" class="calendar-box"

View File

@ -14,9 +14,16 @@
&:active {color:nth($cgr, 3);} &:active {color:nth($cgr, 3);}
} }
.date-input { display:block; width:100%; height:100%; padding:0 5px; line-height:18px; border:1px solid nth($cp, 1); @include ts(); .date-input {position:relative; display:block; width:100%; height:100%;
&:focus { border-color:nth($ct, 1); } .input { width:100%; height:100%;padding:0 5px; line-height:18px; border:1px solid nth($cp, 1);color:nth($cgr, 1); @include ts();
&:focus { border-color:nth($ct, 1); }
&[disabled] {background:#f7f8fb;cursor:not-allowed;}
}
.icon {position:absolute;right:10px;top:4px;font-size:25px;color:nth($cp, 3);
&::after {content:"\e650"}
}
} }
.calendar-box { position:absolute; left:0; top:100%; z-index:65534; width:267px; height:auto; min-height:60px;padding:10px;line-height:35px; border:1px solid #ddd; background:#fff; font-size:14px; color:nth($cgr, 1); text-align:center; box-shadow:0 1px 5px rgba(0, 0, 0, 0.1); .calendar-box { position:absolute; left:0; top:100%; z-index:65534; width:267px; height:auto; min-height:60px;padding:10px;line-height:35px; border:1px solid #ddd; background:#fff; font-size:14px; color:nth($cgr, 1); text-align:center; box-shadow:0 1px 5px rgba(0, 0, 0, 0.1);

View File

@ -81,7 +81,7 @@ export default Anot.component('tree', {
}, },
componentDidMount: function() { componentDidMount: function() {
if (typeof this.props.onCreated === 'function') { if (typeof this.props.onCreated === 'function') {
this.props.onCreated.call(null, this) this.props.onCreated(this)
} }
}, },
state: { state: {
@ -132,7 +132,7 @@ export default Anot.component('tree', {
} }
if (typeof onChecked === 'function') { if (typeof onChecked === 'function') {
onChecked.call(this.$up, item, arr) onChecked(item, arr)
} }
}, },
onSelected: function(el) { onSelected: function(el) {