chore(Dialog): improve code

This commit is contained in:
chenjiahan 2020-08-31 11:53:40 +08:00
parent 44aaa47187
commit e1ac3f9a58
2 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,8 @@
// Utils
import { createNamespace, addUnit, pick } from '../utils';
import { BORDER_TOP, BORDER_LEFT } from '../utils/constant';
// Components
import Popup from '../popup';
import Button from '../button';
import ActionBar from '../action-bar';
@ -19,11 +22,12 @@ export default createComponent({
lazyRender: Boolean,
beforeClose: Function,
messageAlign: String,
showCancelButton: Boolean,
cancelButtonText: String,
cancelButtonColor: String,
confirmButtonText: String,
confirmButtonColor: String,
showCancelButton: Boolean,
closeOnClickOverlay: Boolean,
overlay: {
type: Boolean,
default: true,
@ -44,10 +48,6 @@ export default createComponent({
type: Boolean,
default: true,
},
closeOnClickOverlay: {
type: Boolean,
default: false,
},
},
emits: ['confirm', 'cancel', 'update:show'],
@ -204,13 +204,13 @@ export default createComponent({
return (
<Popup
show={this.show}
role="dialog"
class={[bem([this.theme]), this.className]}
style={{ width: addUnit(this.width) }}
aria-labelledby={this.title || message}
{...{
...pick(this, [
'show',
'overlay',
'transition',
'lazyRender',

View File

@ -1,3 +1,5 @@
import { watch, onMounted, onUnmounted } from 'vue';
// Utils
import { createNamespace, isDef } from '../utils';
import { lockClick } from './lock-click';
@ -6,7 +8,6 @@ import { lockClick } from './lock-click';
import Icon from '../icon';
import Popup from '../popup';
import Loading from '../loading';
import { watch, onMounted, onUnmounted } from 'vue';
const [createComponent, bem] = createNamespace('toast');