unimal-jp / spear

The spear OSS repository
https://late-cloud-6411.spearly.app
MIT License
10 stars 1 forks source link

Set class and id for components #183

Open pandaulait opened 1 year ago

pandaulait commented 1 year ago

Is your feature request related to a problem? Please describe. There were cases where I wanted to set a class or id on the component itself, as shown below

<ButtonComponent class="mt-10"></ButtonComponent>

<SectionComponent id="about"></SectionComponent>

Describe the solution you'd like I'm implementing the following as a workaround right now, so it would be easier to use if you could specify class and id to the component

<SectionComponent>
  <div id="about">...  </div>
</SectionComponent>

However, in order to consider the pros and cons of this issue, we would need to review the current specification that allows multiple elements to be set in the root of a component

<!-- SectionComponent.spear-- >
<div></div>
<div></div>
...

<!-- SectionComponent.spear-- >
<div></div>