Search code examples
vuejs2bootstrap-modal

Is there any way I can do to bind vue with something else apart from id?


I am using vue2+bootstrap building a website. As problems appear, the quickest way to fix em is to bind vue with something else,like class rather than id. So, is there any (pls....pls.... tell me yes....) way I can use vue with it's bound to anything else? thx in advance.


Solution

  • Okay, I tell you yes.

    The el option can be a CSS selector string or an actual HTMLElement.

    More info in official docs.

    But I think id is a proper way when operating DOM in most cases, which avoids excessive responsibility for the class name.