Skip to content

Commit e2126b0

Browse files
committed
fix: flexbox context undefined
1 parent d8e8f15 commit e2126b0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/layout/src/columns.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const T = type({
77

88
}).partial().and(FlexboxType)
99

10-
export default defineComponent<'columns', typeof T.infer, { direction: Ref<'row' | 'column'> }>((attrs, context) => {
10+
export default defineComponent<'columns', typeof T.infer, { direction?: Ref<'row' | 'column'> }>((attrs, context) => {
1111
const direction = ref(toValue(attrs.direction ?? 'column') as 'row' | 'column')
1212
return {
1313
name: 'columns',

packages/layout/src/flexbox.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ export const FlexboxType = type({
1717
basis: type(`string | number`).optional(),
1818
}).and(BlockType)
1919

20-
export default defineComponent<'flexbox', typeof FlexboxType.infer, { direction: Ref<'row' | 'column'> }>((attrs, context) => {
20+
export default defineComponent<'flexbox', typeof FlexboxType.infer, { direction?: Ref<'row' | 'column'> }>((attrs, context) => {
2121
const extend = block(attrs, context)
2222
const direction = ref(toValue(attrs.direction ?? 'row') as string)
23-
const selfDirection = context.direction.value
23+
const selfDirection = context.direction?.value
2424

2525
return {
2626
name: 'flexbox',

packages/layout/src/rows.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const T = type({
77

88
}).partial().and(FlexboxType)
99

10-
export default defineComponent<'rows', typeof T.infer, { direction: Ref<'row' | 'column'> }>((attrs, context) => {
10+
export default defineComponent<'rows', typeof T.infer, { direction?: Ref<'row' | 'column'> }>((attrs, context) => {
1111
const direction = ref(toValue(attrs.direction ?? 'row') as string)
1212
return {
1313
name: 'rows',

0 commit comments

Comments
 (0)