|
|
|
@ -8,7 +8,7 @@ import { defineComponent, h } from 'vue' |
|
|
|
|
import type { |
|
|
|
|
Axis, |
|
|
|
|
Block, |
|
|
|
|
DataRefer, |
|
|
|
|
DataRefer, Theme, |
|
|
|
|
View, |
|
|
|
|
ViewChildren, |
|
|
|
|
Widget, |
|
|
|
@ -55,6 +55,14 @@ function isRefer(s: any): s is DataRefer { |
|
|
|
|
&& typeof s.key === 'string' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const isFlexible = (theme: Theme) => { |
|
|
|
|
return theme.axis != null |
|
|
|
|
|| theme.mainAlign != null |
|
|
|
|
|| theme.crossAlign != null |
|
|
|
|
|| theme.wrap != null |
|
|
|
|
|| theme.gap != null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export function render(view?: ViewChildren, axis?: Axis): VNodeChild { |
|
|
|
|
if (view == null) |
|
|
|
|
return null |
|
|
|
@ -135,7 +143,7 @@ export function render(view?: ViewChildren, axis?: Axis): VNodeChild { |
|
|
|
|
// 所以在这里复用它用于子视图构建
|
|
|
|
|
axis = theme?.axis |
|
|
|
|
|
|
|
|
|
if (theme?.flexible) { |
|
|
|
|
if (theme?.flexible || (theme && theme.flexible == null && isFlexible(theme))) { |
|
|
|
|
Object.assign(css, { |
|
|
|
|
display: 'flex', |
|
|
|
|
flexDirection: axis === 'y' ? 'column' : undefined, |
|
|
|
|