mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-15 09:50:58 +08:00
6cc16bbd06
* chore: add vue-tsc for type check * refactor(components): respect Vue's own style type * refactor(components): improve props type * chore(build): improve types * fix(components): remove unnecessary props * perf(components): use shallowRef * fix(components): add missing property type for table * refactor(components): improve time-picker types * refactor(components): extract import type * refactor(components): improve popper types * refactor(components): upload list types * fix(docs): fix type * better type * fix: remove index
51 lines
868 B
TypeScript
51 lines
868 B
TypeScript
|
|
import type { PropType } from 'vue'
|
|
import type { Options } from '@popperjs/core'
|
|
|
|
export const DEFAULT_FALLBACK_PLACEMENTS = []
|
|
|
|
export const defaultModifiers = [
|
|
{
|
|
name: 'offset',
|
|
options: {
|
|
offset: [0, 12],
|
|
},
|
|
},
|
|
{
|
|
name: 'preventOverflow',
|
|
options: {
|
|
padding: {
|
|
top: 2,
|
|
bottom: 2,
|
|
left: 5,
|
|
right: 5,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
name: 'flip',
|
|
options: {
|
|
padding: 5,
|
|
fallbackPlacements: [],
|
|
},
|
|
},
|
|
{
|
|
name: 'computeStyles',
|
|
options: {
|
|
gpuAcceleration: true,
|
|
adaptive: true,
|
|
},
|
|
},
|
|
]
|
|
|
|
export const defaultPopperOptions = {
|
|
type: Object as PropType<Partial<Options>>,
|
|
default: () => {
|
|
return {
|
|
fallbackPlacements: DEFAULT_FALLBACK_PLACEMENTS,
|
|
strategy: 'fixed',
|
|
modifiers: defaultModifiers,
|
|
} as Partial<Options>
|
|
},
|
|
}
|