prashantpalikhe / nuxt-ssr-lit

SSR support for Lit elements in Nuxt3
Other
42 stars 7 forks source link

Move v-if, v-else-if, v-else to the wrapper if found in the custom elements #61

Closed prashantpalikhe closed 1 year ago

prashantpalikhe commented 1 year ago

Without special transfer for the v-if related attributes,

<acme-button v-if="test">Test</acme-button> 
<acme-button v-else>Rest</acme-button> 

gets transformed to

<LitWrapper><acme-button v-if="test">Test</acme-button></LitWrapper>
<LitWrapper><acme-button v-else>Rest</acme-button> </LitWrapper>

Which is invalid.

This PR makes sure that the transformation results in the following:

<LitWrapper v-if="test"><acme-button>Test</acme-button></LitWrapper>
<LitWrapper v-else><acme-button>Rest</acme-button> </LitWrapper>