But what if you adjusted option A and added a single Delete all button on the cart? Then it's just 1 click for the user. Under option B, user clicks Select all and then Delete = 2 clicks. Under option A, user clicks delete for every item. Under option B, the user selects each item then hits delete = 1 click per item + 1 additional delete click. Under option A, the user clicks delete for each item = 1 click per item. Under option B, the user has to check the box, then hit delete.i.e. Under option A, this is a 1-click operation. Now just look at the user's point of view. You could also include a delete link in addition to the checkbox for every item, but for reasons that will be clear below that would be pretty stupid. Option B - Shopping cart where each item has a checkbox, and you have Select all and Delete all buttons somewhere. Option A - Shopping cart (see ) where there is a delete link for each item in the cart. Our site has some "Save for Later" functionality multi-select might be beneficial for, but overall I'm concerned about implementing it as it doesn't seem widely done.Īnyway if anyone has good examples of multi-select delete/save in Shopping Carts - or compelling articles why that functionality shouldn't be used for me to try to beat the requirement back with any help would be appreciated - thanks! I'd love to be able to push back on this and prove it's a bad user experience - but honestly the requestor is so adamant about it it's probably an unwinnable discussion.Īnyway does anyone have examples of good implementations of this functionality? It seems like it's going to add a lot of clutter and visual noise and overall is an atypical implementation. Edit: AmazonSupply does this, but at the expense of line-item delete. I've researched dozens of competitor carts and not one offers delete-multiple-items-at-once functionality. With a competent engineering team, you could probably build the equivalent on top of native Custom Elements - but this also means you are taking on the long-term maintenance burden of an in-house framework, while losing out on the ecosystem and community benefits of a mature framework like Vue.My boss is insistent we need to build functionality to allow users to delete multiple items out of their shopping cart at once (e.g., checkboxes, with a "Select All" button/link, and "Delete" at the top and bottom of pages).Ĭurrently we have the far more typical "Delete" option at the item/product level. Vue's component model is designed with these needs in mind as a coherent system. Native custom elements SSR typically involves simulating the DOM in Node.js and then serializing the mutated DOM, while Vue SSR compiles into string concatenation whenever possible, which is much more efficient. To build an actual application, we need quite a few additional capabilities which the platform does not cover:Ī declarative and efficient templating system Ī reactive state management system that facilitates cross-component logic extraction and reuse Ī performant way to render the components on the server and hydrate them on the client (SSR), which is important for SEO and Web Vitals metrics such as LCP. However, Web Components APIs are relatively low-level and bare-bones. There is indeed a certain level of feature overlap between Custom Elements and Vue Components: they both allow us to define reusable components with data passing, event emitting, and lifecycle management. Here we will try to explain why we believe that this is an overly simplistic take on the problem. Some developers believe that framework-proprietary component models should be avoided, and that exclusively using Custom Elements makes an application "future-proof". Js // module.exports = Web Components vs. If you are using Vue with a build setup, the option should be passed via build configs since it is a compile-time option. To let Vue know that certain elements should be treated as custom elements and skip component resolution, we can specify the compilerOptions.isCustomElement option. This will cause Vue to emit a "failed to resolve component" warning during development. Consuming custom elements inside a Vue application largely works the same as using native HTML elements, with a few things to keep in mind: Skipping Component Resolution īy default, Vue will attempt to resolve a non-native HTML tag as a registered Vue component before falling back to rendering it as a custom element. Vue scores a perfect 100% in the Custom Elements Everywhere tests. Whether you are integrating custom elements into an existing Vue application, or using Vue to build and distribute custom elements, you are in good company. Vue has excellent support for both consuming and creating custom elements. We consider Vue and Web Components to be primarily complementary technologies. Web Components is an umbrella term for a set of web native APIs that allows developers to create reusable custom elements.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |