Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 year ago

Vue 3 (Setup Composition API + Composables) Solution

sass/scss, vue, bem
raionus•370
@sinjin25
A solution to the E-commerce product page challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

Edit: somehow the CSS reset didn't land in the built files which is messing things up xd

This is a Vue 3 solution using singleton composables to access/modify state across different components. This lets you avoid the pattern of parent + prop drill + emit or bringing in something overkill (Vuex, Pinia.).

Critiques: I had a lot of trouble with sizing the SVGs and gave up on that.

The CSS got a little disorganized at times. It's not unusable because it's scoped but next time I might try matching prefixes to folder names ex: components/header to header-something1 header-something2. Then header/cart would be header-cart-somethingA header-cart-somethingB

What challenges did you encounter, and how did you overcome them?

Nothing besides the svgs.

What specific areas of your project would you like help with?

Not sure how to resize the SVGs. I just copied and pasted them into the html where needed at their default size. Changing the width and height attributes caused them to cut off.

Font Awesome allows you to scale them with font-size: 1em, etc. but that didn't appear to be working here so not sure why that is because I obviously don't understand SVGs. If anyone knows what's up with this then feel free to comment.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on raionus's solution.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License