New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vue 3: "v-else" conditional compilation error in Pug template (SFC) #7756
Comments
Found the error source
Because Vue templates are a partial, pug doesn't make any assumption of the doctype, so it will mirror the attribute. Because of this, you will end up with the attribute If you specify |
Ok, so I PR'd the fix, because pug will prefer a doctype declared in a template over the doctype declared in options, so if you ever want to break this example again, it would take explicit effort, by manually making the example HTML 4 or something with a doctype declaration. (I think HTML5 only as restrictive, but HTML5 by default as quite reasonable given the web landscape of today.) |
Thanks @Jengamon! hope this PR fix will be included in the next release |
馃悰 bug report
Compile a simple Vue 3 app with Parcel 2 (watch mode) and use a
v-if
andv-else
conditional statement in a Pug template, Vue Transformer will output a parse error.Single File Component Example:
Error:
Also I noticed, using instead
v-else=""
the template compiles successfully.馃帥 Configuration (.babelrc, package.json, cli command)
馃 Expected Behavior
Vue Transformer should support
v-else
in Pug templates.馃槸 Current Behavior
Compilation Error
馃拋 Possible Solution
Check
v-else
statement in pug template of SFCs.馃敠 Context
Compile a simple Vue 3 application using a Pug template in a SFC.
馃捇 Code Sample
Simple reproduction here.
馃實 Your Environment
The text was updated successfully, but these errors were encountered: