Issue #1126Opened May 22, 2018by faizansaiyed1 reactions

[Question] How to Add Custom attribute in a Block through Block Manager?

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)

faizansaiyedMay 23, 20181 reactions

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

d3vrMay 22, 20180 reactions

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

lock[bot]September 17, 20190 reactions

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

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.