Skip to content

Commit

Permalink
fix(snackbar/types): fix types of related loading props
Browse files Browse the repository at this point in the history
  • Loading branch information
BeADre committed Oct 15, 2021
1 parent f6b8bbf commit 0e8d4f4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/varlet-ui/src/loading/props.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { PropType } from 'vue'

type LoadingType = 'circle' | 'wave' | 'cube' | 'rect' | 'disappear'
export type LoadingType = 'circle' | 'wave' | 'cube' | 'rect' | 'disappear'

type LoadingSize = 'normal' | 'mini' | 'small' | 'large'
export type LoadingSize = 'normal' | 'mini' | 'small' | 'large'

export function typeValidator(type: string): boolean {
return ['circle', 'wave', 'cube', 'rect', 'disappear'].includes(type)
Expand Down
7 changes: 4 additions & 3 deletions packages/varlet-ui/src/snackbar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { App, Component } from 'vue'
import { reactive, TransitionGroup } from 'vue'
import VarSnackbarCore from './core.vue'
import VarSnackbar from './Snackbar.vue'
import context from '../context'
import { reactive, TransitionGroup } from 'vue'
import type { LoadingType, LoadingSize } from '../loading/props'
import { mountInstance } from '../utils/components'
import { isPlainObject, toNumber } from '../utils/shared'

Expand All @@ -18,8 +19,8 @@ interface SnackbarOptions {
type?: SnackbarType
content?: string
position?: 'top' | 'center' | 'bottom'
loadingType?: string
loadingSize?: string
loadingType?: LoadingType
loadingSize?: LoadingSize
teleport?: string
lockScroll?: boolean
contentClass?: string
Expand Down
8 changes: 6 additions & 2 deletions packages/varlet-ui/types/snackbar.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import type { App } from 'vue'
import { VarComponent } from './varComponent'

export type LoadingType = 'circle' | 'wave' | 'cube' | 'rect' | 'disappear'

export type LoadingSize = 'normal' | 'mini' | 'small' | 'large'

export interface SnackbarProps {
type?: SnackbarType
content?: string
position?: 'top' | 'center' | 'bottom'
loadingType?: string
loadingSize?: string
loadingType?: LoadingType
loadingSize?: LoadingSize
teleport?: string
lockScroll?: boolean
contentClass?: string
Expand Down

0 comments on commit 0e8d4f4

Please sign in to comment.