Trying To Add Trait For Custom Component But Its Not Showing #4663
Unanswered
heyitsuzair
asked this question in
Q&A
Replies: 1 comment
|
try move isComponent inside model editor.DomComponents.addType("input", {
model: {
defaults: {
traits: [
// Strings are automatically converted to text types
"name", // Same as: { type: 'text', name: 'name' }
"placeholder",
{
type: "select", // Type of the trait
label: "Type", // The label you will see in Settings
name: "type", // The name of the attribute/property to use on component
options: [
{ id: "text", name: "Text" },
{ id: "email", name: "Email" },
{ id: "password", name: "Password" },
{ id: "number", name: "Number" },
],
},
],
// As by default, traits are binded to attributes, so to define
// their initial value we can use attributes
attributes: { type: "text", required: true },
},
isComponent: (el) => el.tagName == "INPUT",
},
});and you shouldnt put style inside blockManager ... content grapesjs.com/docs/modules/Blocks.html#avoid-styles |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Below Is The Code Of My Custom Component In Which I want to add custom trait after title and id but it is not showing.
All reactions