# GpDialog 弹出框
# Introduction
import PressGpDialog from 'press-plus/press-gp-dialog/press-gp-dialog';
export default {
components: {
PressGpDialog,
}
}
# Code Demo
# Basic usage
<PressGpDialog
id="press-gp-dialog"
ref="press-gp-dialog"
/>
import PressGpDialogHandler from 'press-plus/press-gp-dialog';
export default {
methods: {
onShowDialog(type) {
PressGpDialogHandler.show({
title: 'A pop-up window',
cancelText: type === 'one' ? '' : 'I'll think about it',
confirmText: 'Execute immediately',
content: 'Reject bad code, keep it simple, keep it pure, and pursue efficiency',
horizontal: false,
}).then(() => {
this.onGTip('confirm');
})
.catch(() => {
this.onGTip('cancel');
});
},
},
}
# API
# Options
When calling DialogPlus through a function, the following options are supported:
| Parameters | Description | Type | Default value |
|---|---|---|---|
| show | Whether to display the pop-up window | boolean | false |
| title | title | string | - |
| content | content | string | - |
| htmlContent | html content | string | - |
| confirmText | Confirm button | string | - |
| cancelText | Cancel button | string | - |
| subTip | Tip | string | - |
| closeOnClickOverlay | Whether to close the pop-up window when clicking on the mask layer | boolean | false |
| htmlFilterClick | Callback when html content is clicked | function | - |
| horizontal | Whether it is horizontal version | boolean | false |
| zIndex | level | number | 100 |