Issue #2813💬 AnsweredOpened June 3, 2020by KaytotheH0 reactions

Blocks attributes

快速解答by artf

You can do this editor.Blocks.get('text').set({ attributes: { class: 'my-custom-class' } })

Read full answer below ↓

Question

const blocktext = blockManager.get('text').set({ label: 'Modified text', attributes: { } }) I want to add an attribute to the original text block, I want the attribute to give the user the option of giving the component, time to appear and disappear at another time. My question is, what are the attributes that I can make use of? and does it work if I refer in the attribute to a javascript that allows him to do this function?

Answers (1)

artfJune 17, 2020

You can do this editor.Blocks.get('text').set({ attributes: { class: 'my-custom-class' } })

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.