Issue #2819Opened June 10, 2020by akashdesale980 reactions

[Question] I am updating trait using addTrait function? It updates and adds the trait in trait manager but unable to reflect it in html section of codeManager?

Question

Code SnippetTEXT
I have written the following code - 

const component = editor.getSelected();
 component.addTrait({
        name: 'traitName',
        type: 'text', label: 'traitLabel', value: 'traitValue'
      });
      const traits = component.get('traits');
      traits.forEach(trait => console.log(trait.props()))

Answers (1)

artfJune 17, 20200 reactions

Traits change the component (and its final HTML) when you use them. By simply updating traits collection in the component doesn't make any change to it on the HTML side

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.