Can anyone give me an example how to use Column? #3381
bahrijar
started this conversation in
Documentation
Replies: 1 comment
-
it's been months, but I hope this helps. you can use this template as the base // insert-drop-down-menu.tsx
const items = [{
items: [{
value: ColumnPlugin.key,
label: 'Column',
description: 'Column',
icon: Icons.ol, // this is not the correct icon, change it
}]
}];
// inside return of InsertDropdownMenu add another case
case ColumnPlugin.key: {
insertColumnGroup(editor);
break;
}
// plate-editor.tsx
export const useMyEditor = () => {
const editor = createPlateEditor({
plugins: [
// ...
ColumnPlugin,
ColumnItemPlugin,
// ...
]
override: {
components: withDraggables(
withPlaceholders({
[ColumnPlugin.key]: ColumnGroupElement,
[ColumnItemPlugin.key]: ColumnElement,
}),
)
}
});
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i already follow the instruction from the docs, but why when i insert the element, popover column group not appear, and the column only create 1 column
![image](https://private-user-images.githubusercontent.com/39976180/349933323-0adaba4e-3d9d-4b04-a402-800aa9a8e65c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNTE1MzEsIm5iZiI6MTczOTA1MTIzMSwicGF0aCI6Ii8zOTk3NjE4MC8zNDk5MzMzMjMtMGFkYWJhNGUtM2Q5ZC00YjA0LWE0MDItODAwYWE5YThlNjVjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDIxNDcxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc3OWJjODdhMmY2MTI4YThiMDIzNWUzODlkMzkxYzkzZTRlYTI1NDM0NjVlNDc4OWY0OGViOWViOGJiOTE0YzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.WL_o2T4CCsqr9tqiE23cjiZwpjFvTW8lKqrg9Fjqdwg)
Beta Was this translation helpful? Give feedback.
All reactions