Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #9114 correct the compiled code for multiline v-if in scoped slots #9119

Merged
merged 2 commits into from
Dec 1, 2018

Conversation

subu28
Copy link
Contributor

@subu28 subu28 commented Nov 28, 2018

add wrapping paranthesis for v-if conditions

the generated code for elements with template in scopedslots was wrong when multiline v-if starting
with a newline was used

fix #9114

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

…ng paranthesis for v-if conditi

the generated code for elements with template in scopedslots was wrong when multiline v-if starting
with a newline was used

fix #9114
@subu28 subu28 changed the title fix(fix compiled code for multiline v-if in scoped slots): add wrappi… fix #9114 correct the compiled code for multiline v-if in scoped slots Nov 28, 2018
@posva
Copy link
Member

posva commented Nov 28, 2018

Let's not add the parenthesis if it isn’t necessary. Also, could you add a test?

@subu28
Copy link
Contributor Author

subu28 commented Nov 28, 2018

Let's not add the parenthesis if it isn’t necessary.

I wanted to until I checked how the output looks when the el.tag is not template. https://template-explorer.vuejs.org/#%3Cdiv%3E%0A%20%20%20%20%3Csome%0A%20%20%20%20%20%20slot%3D%22row_expander%22%0A%20%20%20%20%20%20slot-scope%3D%22%7B%0A%20%20%20%20%20%20%20%20row%0A%20%20%20%20%20%20%7D%22%0A%20%20%20%20%20%20v-if%3D%22longCondition1%22%0A%20%20%20%20%3E%0A%20%20%20%20%20%20%3Csomething%20%2F%3E%20%3Csomething%20%2F%3E%0A%20%20%20%20%3C%2Fsome%3E%0A%20%3C%2Fdiv%3E

Over there the wrapping parenthesis are always added. I figured this way is easier and also failproof.

Also, could you add a test?

I will try to. Might be a bit delayed due to me not being very experienced with tests and my timezone.

…ng paranthesis for v-if conditi

the generated code for elements with template in scopedslots was wrong when multiline v-if starting
with a newline was used

fix #9114
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect compiled code when usinig multiline v-if on template element as a slot renderer
3 participants