Custom Trait is not working. #5687
-
What's wrong with this code?
|
Beta Was this translation helpful? Give feedback.
Answered by
mosh-tudor
Feb 20, 2024
Replies: 1 comment 1 reply
-
@PallobST https://grapesjs.com/docs/modules/Traits.html#add-traits-to-components Move traits part to model/defaults: model: {
defaults: {
tagName: 'p',
content: 'This is a text',
traits: [
{
type: 'custom-text', // Trait type
name: 'Text', // Trait name
label: 'Text', // Label displayed in the traits panel
},
],
},
}, |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
PallobST
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@PallobST https://grapesjs.com/docs/modules/Traits.html#add-traits-to-components
Move traits part to model/defaults: