Issue #1126πŸ’¬ AnsweredOpened May 22, 2018by faizansaiyed1 reactions

How to Add Custom attribute in a Block through Block Manager?

Quick answerby faizansaiyed❀ 1

Thanks, actually I found alternative to @ i.e. v-on for using @ in VueJS

Read full answer below ↓

Question

Hello, I have a custom block in which there is custom attribute @call-method="searchProduct". But when I directly use this in Grapes JS as <datafieldsearch @call-method="searchProduct" label="Search"></datafieldsearch> it throws an error saying Uncaught DOMException: Failed to execute 'setAttribute' on 'Element': '@call-method' is not a valid attribute name.

So how can I pass this custom attribute through bm.add()?

Answers (3)

faizansaiyedβ€’ May 23, 2018

Thanks, actually I found alternative to @ i.e. v-on for using @ in VueJS

d3vrβ€’ May 22, 2018

You can't use @ in an attribute's name, use something like data-call-method instead

lock[bot]β€’ September 17, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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.