mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Dialog): should not submit form after clicking button (#10570)
* fix(Dialog): should not submit form * chore: update snapshot
This commit is contained in:
parent
c25edf88e4
commit
e045ce6bfd
@ -173,6 +173,7 @@ export default createComponent({
|
|||||||
loading={this.loading.cancel}
|
loading={this.loading.cancel}
|
||||||
text={this.cancelButtonText || t('cancel')}
|
text={this.cancelButtonText || t('cancel')}
|
||||||
style={{ color: this.cancelButtonColor }}
|
style={{ color: this.cancelButtonColor }}
|
||||||
|
nativeType="button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
this.handleAction('cancel');
|
this.handleAction('cancel');
|
||||||
}}
|
}}
|
||||||
@ -185,6 +186,7 @@ export default createComponent({
|
|||||||
loading={this.loading.confirm}
|
loading={this.loading.confirm}
|
||||||
text={this.confirmButtonText || t('confirm')}
|
text={this.confirmButtonText || t('confirm')}
|
||||||
style={{ color: this.confirmButtonColor }}
|
style={{ color: this.confirmButtonColor }}
|
||||||
|
nativeType="button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
this.handleAction('confirm');
|
this.handleAction('confirm');
|
||||||
}}
|
}}
|
||||||
|
@ -40,9 +40,9 @@ exports[`renders demo correctly 1`] = `
|
|||||||
<div role="dialog" aria-labelledby="标题" tabindex="0" class="van-dialog" style="display: none;" name="van-dialog-bounce">
|
<div role="dialog" aria-labelledby="标题" tabindex="0" class="van-dialog" style="display: none;" name="van-dialog-bounce">
|
||||||
<div class="van-dialog__header">标题</div>
|
<div class="van-dialog__header">标题</div>
|
||||||
<div class="van-dialog__content"><img src="https://img01.yzcdn.cn/vant/apple-3.jpg"></div>
|
<div class="van-dialog__content"><img src="https://img01.yzcdn.cn/vant/apple-3.jpg"></div>
|
||||||
<div class="van-hairline--top van-dialog__footer"><button class="van-button van-button--default van-button--large van-dialog__cancel">
|
<div class="van-hairline--top van-dialog__footer"><button type="button" class="van-button van-button--default van-button--large van-dialog__cancel">
|
||||||
<div class="van-button__content"><span class="van-button__text">取消</span></div>
|
<div class="van-button__content"><span class="van-button__text">取消</span></div>
|
||||||
</button><button class="van-button van-button--default van-button--large van-dialog__confirm van-hairline--left">
|
</button><button type="button" class="van-button van-button--default van-button--large van-dialog__confirm van-hairline--left">
|
||||||
<div class="van-button__content"><span class="van-button__text">确认弹窗</span></div>
|
<div class="van-button__content"><span class="van-button__text">确认弹窗</span></div>
|
||||||
</button></div>
|
</button></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,9 +4,9 @@ exports[`allow-html prop 1`] = `<div class="van-dialog__message"><span>tex
|
|||||||
|
|
||||||
exports[`button color 1`] = `
|
exports[`button color 1`] = `
|
||||||
<div role="dialog" tabindex="0" class="van-dialog" name="van-dialog-bounce">
|
<div role="dialog" tabindex="0" class="van-dialog" name="van-dialog-bounce">
|
||||||
<div class="van-hairline--top van-dialog__footer"><button class="van-button van-button--default van-button--large van-dialog__cancel" style="color: white;">
|
<div class="van-hairline--top van-dialog__footer"><button type="button" class="van-button van-button--default van-button--large van-dialog__cancel" style="color: white;">
|
||||||
<div class="van-button__content"><span class="van-button__text">取消</span></div>
|
<div class="van-button__content"><span class="van-button__text">取消</span></div>
|
||||||
</button><button class="van-button van-button--default van-button--large van-dialog__confirm van-hairline--left" style="color: red;">
|
</button><button type="button" class="van-button van-button--default van-button--large van-dialog__confirm van-hairline--left" style="color: red;">
|
||||||
<div class="van-button__content"><span class="van-button__text">确认</span></div>
|
<div class="van-button__content"><span class="van-button__text">确认</span></div>
|
||||||
</button></div>
|
</button></div>
|
||||||
</div>
|
</div>
|
||||||
@ -14,9 +14,9 @@ exports[`button color 1`] = `
|
|||||||
|
|
||||||
exports[`button text 1`] = `
|
exports[`button text 1`] = `
|
||||||
<div role="dialog" tabindex="0" class="van-dialog" name="van-dialog-bounce">
|
<div role="dialog" tabindex="0" class="van-dialog" name="van-dialog-bounce">
|
||||||
<div class="van-hairline--top van-dialog__footer"><button class="van-button van-button--default van-button--large van-dialog__cancel">
|
<div class="van-hairline--top van-dialog__footer"><button type="button" class="van-button van-button--default van-button--large van-dialog__cancel">
|
||||||
<div class="van-button__content"><span class="van-button__text">Custom cancel</span></div>
|
<div class="van-button__content"><span class="van-button__text">Custom cancel</span></div>
|
||||||
</button><button class="van-button van-button--default van-button--large van-dialog__confirm van-hairline--left">
|
</button><button type="button" class="van-button van-button--default van-button--large van-dialog__confirm van-hairline--left">
|
||||||
<div class="van-button__content"><span class="van-button__text">Custom confirm</span></div>
|
<div class="van-button__content"><span class="van-button__text">Custom confirm</span></div>
|
||||||
</button></div>
|
</button></div>
|
||||||
</div>
|
</div>
|
||||||
@ -25,7 +25,7 @@ exports[`button text 1`] = `
|
|||||||
exports[`default slot 1`] = `
|
exports[`default slot 1`] = `
|
||||||
<div role="dialog" tabindex="0" class="van-dialog" name="van-dialog-bounce">
|
<div role="dialog" tabindex="0" class="van-dialog" name="van-dialog-bounce">
|
||||||
<div class="van-dialog__content">Custom Message</div>
|
<div class="van-dialog__content">Custom Message</div>
|
||||||
<div class="van-hairline--top van-dialog__footer"><button class="van-button van-button--default van-button--large van-dialog__confirm">
|
<div class="van-hairline--top van-dialog__footer"><button type="button" class="van-button van-button--default van-button--large van-dialog__confirm">
|
||||||
<div class="van-button__content"><span class="van-button__text">确认</span></div>
|
<div class="van-button__content"><span class="van-button__text">确认</span></div>
|
||||||
</button></div>
|
</button></div>
|
||||||
</div>
|
</div>
|
||||||
@ -34,7 +34,7 @@ exports[`default slot 1`] = `
|
|||||||
exports[`title slot 1`] = `
|
exports[`title slot 1`] = `
|
||||||
<div role="dialog" tabindex="0" class="van-dialog" name="van-dialog-bounce">
|
<div role="dialog" tabindex="0" class="van-dialog" name="van-dialog-bounce">
|
||||||
<div class="van-dialog__header van-dialog__header--isolated">Custom Title</div>
|
<div class="van-dialog__header van-dialog__header--isolated">Custom Title</div>
|
||||||
<div class="van-hairline--top van-dialog__footer"><button class="van-button van-button--default van-button--large van-dialog__confirm">
|
<div class="van-hairline--top van-dialog__footer"><button type="button" class="van-button van-button--default van-button--large van-dialog__confirm">
|
||||||
<div class="van-button__content"><span class="van-button__text">确认</span></div>
|
<div class="van-button__content"><span class="van-button__text">确认</span></div>
|
||||||
</button></div>
|
</button></div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user