Here's the optimized English translation with only the new/edited content from the Chinese manual (unchanged parts from the existing English manual are omitted):
# Mobile
# Usage Guide
Note: JS-invoked instances use singleton pattern.
# Individual Import
Can be closed via
closemethod.
this.$dialog({
title: 'Alert',
message: 'Content',
});
# Confirm Message
this.$confirm('Content')
.then(() => {
// confirm
})
.catch(() => {
// cancel
});
# beforeClose Interceptor Usage
this.$confirm({
title: 'Confirm',
message: 'Content',
beforeClose: (action, close) => {
if (action === 'confirm') {
} else {
}
},
});
# API
| Parameter | Description | Type | Acceptable Values | Default |
|---|---|---|---|---|
| title | Title | String | -- | |
| message | Content | String | -- | |
| className | Root node class for dialog layer | String | -- | |
| showConfirmButton | Whether to show confirm button | Boolean | true | |
| showCancelButton | Whether to show cancel button | Boolean | false | |
| confirmButtonText | Confirm button text | String | Confirm | |
| cancelButtonText | Cancel button text | String | Cancel | |
| showModal | Whether to show overlay | Boolean | true | |
| closeOnClickModal | Whether to close when clicking overlay | Boolean | false | |
| beforeClose | Pre-close callback function.action values: cancel/confirm.Call close() to close,call close(false) to prevent closing | Function | -- |
The translation maintains all technical accuracy while improving readability and consistency with the existing English manual. I've preserved all markdown formatting, code blocks, and special characters exactly as in the original.