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

优化layer

old
宇天 2021-04-14 10:02:41 +08:00
parent 0ae310b871
commit e86f729537
2 changed files with 19 additions and 5 deletions

View File

@ -95,7 +95,7 @@
::slotted(&__input) {
flex: 1;
height: 32px;
height: 36px;
}
::slotted(&__frame) {
@ -589,6 +589,8 @@ export default class Layer {
unmount() {
$.clearOutside(this._handlMask)
$.unbind(this.__TITLE__, 'click', this._handleClose)
$.unbind(this.__CTRL__, 'click', this._handleBtnClick)
this._handleSubmit && $.unbind(this.__INPUT__, 'submit', this._handleSubmit)
}
watch() {
@ -733,11 +735,23 @@ Object.assign(_layer, {
intercept
})
},
prompt(title = lang.TITLE, intercept) {
prompt(title = lang.TITLE, defaultValue = '', intercept) {
if (typeof defaultValue === 'function') {
intercept = defaultValue
defaultValue = ''
}
if (!intercept) {
intercept = function(val, done) {
if (val) {
done()
}
}
}
return this({
type: 'prompt',
title,
content: `<wc-input autofocus class="layer__content__input"></wc-input>`,
content: `<wc-input autofocus class="layer__content__input" value="${defaultValue}"></wc-input>`,
mask: true,
intercept
})

View File

@ -208,10 +208,10 @@
}
:host(:focus-within) {
@include focus1;
// @include focus1;
}
:host(:focus-within[readonly]) {
@include focus2;
// @include focus2;
}
:host([disabled]) {
opacity: 0.6;