mirror of
				https://gitee.com/vant-contrib/vant.git
				synced 2025-11-04 21:02:09 +08:00 
			
		
		
		
	* feat(dialog): add new prop button-theme & change default confirm button text color * test(dialog): update snapshot * refactor(dialog): rename button-theme to theme * refactor(dialog): add theme definition * docs(dialog): add version tip & change default confirm-button-color
		
			
				
	
	
		
			49 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import { VanComponent } from './component';
 | 
						|
 | 
						|
type DialogAction = 'confirm' | 'cancel';
 | 
						|
type DialogDone = (close?: boolean) => void;
 | 
						|
 | 
						|
export type DialogOptions = {
 | 
						|
  title?: string;
 | 
						|
  width?: string | number;
 | 
						|
  message?: string;
 | 
						|
  theme?: string;
 | 
						|
  overlay?: boolean;
 | 
						|
  className?: any;
 | 
						|
  allowHtml?: boolean;
 | 
						|
  lockScroll?: boolean;
 | 
						|
  transition?: string;
 | 
						|
  messageAlign?: string;
 | 
						|
  overlayClass?: string;
 | 
						|
  overlayStyle?: object;
 | 
						|
  closeOnPopstate?: boolean;
 | 
						|
  cancelButtonText?: string;
 | 
						|
  cancelButtonColor?: string;
 | 
						|
  confirmButtonText?: string;
 | 
						|
  confirmButtonColor?: string;
 | 
						|
  showConfirmButton?: boolean;
 | 
						|
  showCancelButton?: boolean;
 | 
						|
  closeOnClickOverlay?: boolean;
 | 
						|
  getContainer?: string | (() => Element);
 | 
						|
  beforeClose?: (action: DialogAction, done: DialogDone) => void;
 | 
						|
};
 | 
						|
 | 
						|
export interface Dialog {
 | 
						|
  (options: DialogOptions): Promise<DialogAction>;
 | 
						|
  alert(options: DialogOptions): Promise<DialogAction>;
 | 
						|
  confirm(options: DialogOptions): Promise<DialogAction>;
 | 
						|
  close(): void;
 | 
						|
  install(): void;
 | 
						|
  setDefaultOptions(options: DialogOptions): void;
 | 
						|
  resetDefaultOptions(): void;
 | 
						|
  Component: typeof VanComponent;
 | 
						|
}
 | 
						|
 | 
						|
declare module 'vue/types/vue' {
 | 
						|
  interface Vue {
 | 
						|
    $dialog: Dialog;
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
export const Dialog: Dialog;
 |