feat(Picker): add confirm、cancel slot (#7377)
This commit is contained in:
+18
-10
@@ -270,22 +270,30 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
genCancel() {
|
||||
return (
|
||||
<button type="button" class={bem('cancel')} onClick={this.cancel}>
|
||||
{this.slots('cancel') || this.cancelButtonText || t('cancel')}
|
||||
</button>
|
||||
);
|
||||
},
|
||||
|
||||
genConfirm() {
|
||||
return (
|
||||
<button type="button" class={bem('confirm')} onClick={this.confirm}>
|
||||
{this.slots('confirm') || this.confirmButtonText || t('confirm')}
|
||||
</button>
|
||||
);
|
||||
},
|
||||
|
||||
genToolbar() {
|
||||
if (this.showToolbar) {
|
||||
return (
|
||||
<div class={bem('toolbar')}>
|
||||
{this.slots() || [
|
||||
<button type="button" class={bem('cancel')} onClick={this.cancel}>
|
||||
{this.cancelButtonText || t('cancel')}
|
||||
</button>,
|
||||
this.genCancel(),
|
||||
this.genTitle(),
|
||||
<button
|
||||
type="button"
|
||||
class={bem('confirm')}
|
||||
onClick={this.confirm}
|
||||
>
|
||||
{this.confirmButtonText || t('confirm')}
|
||||
</button>,
|
||||
this.genConfirm(),
|
||||
]}
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user