Skip to content

Commit

Permalink
fix(ui/dialog): 修复类型声明
Browse files Browse the repository at this point in the history
affects: @varlet/ui
  • Loading branch information
haoziqaq committed Apr 6, 2021
1 parent 76d4e4e commit 29639b8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions packages/varlet-ui/src/dialog/Dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<div class="var-dialog__actions">
<var-button
class="var-dialog__button var-dialog__cancel-button"
var-dialog-cover
text
:text-color="cancelButtonTextColor"
:color="cancelButtonColor"
Expand All @@ -37,6 +38,7 @@
</var-button>
<var-button
class="var-dialog__button var-dialog__confirm-button"
var-dialog-cover
text
:text-color="confirmButtonTextColor"
:color="confirmButtonColor"
Expand Down
6 changes: 3 additions & 3 deletions packages/varlet-ui/src/dialog/dialog.less
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
justify-content: flex-end;
}

&__button {
&__button[var-dialog-cover] {
margin-left: @dialog-button-margin-left;
background-color: transparent;
box-shadow: none;
Expand All @@ -46,11 +46,11 @@
}
}

&__confirm-button {
&__confirm-button[var-dialog-cover] {
color: @dialog-confirm-button-color;
}

&__cancel-button {
&__cancel-button[var-dialog-cover] {
color: @dialog-cancel-button-color;
}
}
5 changes: 4 additions & 1 deletion packages/varlet-ui/src/dialog/example/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export default {
close: () => Snackbar.info('close'),
}
const createBasic = () => Dialog(pack.value.message)
const createBasic = () =>
Dialog({
message: pack.value.message,
})
const createAction = async () => actions[await Dialog(pack.value.message)]()
Expand Down
2 changes: 1 addition & 1 deletion packages/varlet-ui/types/dialog.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface DialogOptions {
}

export interface Dialog {
(options: DialogOptions): Promise<DialogActions>
(options: DialogOptions | string): Promise<DialogActions>
install(app: App): void
close(): void
Component: DialogComponent
Expand Down
2 changes: 1 addition & 1 deletion packages/varlet-ui/types/picker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface PickerOptions {
}

export interface Picker {
(options: PickerOptions): Promise<PickerResolvedData>
(options: PickerOptions | Texts): Promise<PickerResolvedData>
install(app: App): void
close(): void
Component: PickerComponent
Expand Down

0 comments on commit 29639b8

Please sign in to comment.