grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

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

Open faizansaiyed opened this issue 8 years ago • 3 comments

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()?

faizansaiyed avatar May 22 '18 04:05 faizansaiyed

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

d3vr avatar May 22 '18 12:05 d3vr

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

faizansaiyed avatar May 23 '18 05:05 faizansaiyed

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.

lock[bot] avatar Sep 17 '19 15:09 lock[bot]