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

Lesson 8: onSale #6

Open
martijnvegmond-cw opened this issue Sep 28, 2020 · 1 comment
Open

Lesson 8: onSale #6

martijnvegmond-cw opened this issue Sep 28, 2020 · 1 comment

Comments

@martijnvegmond-cw
Copy link

martijnvegmond-cw commented Sep 28, 2020

It's not a real issue, more of a question actually.

On this lesson the onSale property is used combined with the computed property sale. But when you change the onSale value, the p tag stays on the page and shows empty space. Is there a specific reason for it to do use it this way?

The way I see it, you could also use the following;

<p v-if="onSale">
<p v-shown="onSale">

And remove the check from the computed property.

@FelixSchwarz
Copy link

If the <p> tag is only displayed if the variant is on sale the rest of the page content would change its position making it hard to select the other variant. In general it seems good UI practice to keep the layout (mostly) the same even when the data changes.

Btw just a nitpick: the attribute is v-show (extra "n").

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

No branches or pull requests

2 participants