mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
chore(Dialog): improve code
This commit is contained in:
parent
44aaa47187
commit
e1ac3f9a58
@ -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',
|
||||
|
@ -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');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user