Skip to main content
13 votes

Vue.js search functionality

One improvement would be factoring out the repeated call to this.search.toLowerCase() and storing the result in a block-scoped constant so it: doesn't need to be ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
9 votes
Accepted

Vue.js search functionality

It is really hard to say, but at least for me, your code is fine. It seems readable and has no issues. Perhaps if you want to change the style and make it more "canonical", you could write ...
sɪʒɪhɪŋ βɪstɦa kxɐll's user avatar
8 votes
Accepted

Vue - It's the Royal Game of Ur

\$\color{red}{\textrm{warning: cheesy meme with bad pun below - if you don't like those, then please skip it...}}\ \$ Question responses Do I have too many / too few components? I am aiming to make ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
8 votes

Vue.js search functionality

Another way is to create an array from name and category and combine some method with ...
StepUp's user avatar
  • 553
6 votes

Vue.js search functionality

It doesn't look like this has been suggested yet but you can use object destructuring so you don't have to repeat blog a couple of times. ...
James Fenwick's user avatar
6 votes
Accepted

Best way to do unknown number of nested v-for loops, or how to do while loops in VueJs (is there a "v-while"?)

There is no v-while, no. You can however use v-for over a computed property (which you can compute using ...
Simon Forsberg's user avatar
6 votes

Vue 3 audio player

in the method getTracks(): this.tracks =response; this.tracks=response.data.tracks; No need to set ...
Chinedu Lawrence's user avatar
6 votes
Accepted

Vue 3 audio player

Firstly, just want to say great job in creating your audio player! (I think I may have commented on one of the earlier issues you posted). Secondly there is nothing "wrong" with your code ...
Daniel Storey's user avatar
5 votes
Accepted

Extracting data from vue-chartjs into an array of datasets

False alarm! No callback hell here. While this code can certainly be refactored a bit, I fail to see callback hell anywhere around. Callback hell is normally a term applied to the code that is ...
Igor Soloydenko's user avatar
5 votes

Resizable containers with VueJS

In accordance with the D.R.Y. principle: the markup can be simplified by registering a component - and a template can be used with an X-Template. For example - add a ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
5 votes

Display properties of a country, from online service

Regarding Vue this code looks quite good. I do however have some issues with the general JavaScript and HTML. I'm not a big fan of using empty strings for missing data. ...
RoToRa's user avatar
  • 11k
4 votes
Accepted

Vue.js code to update selection on screen

One technique would be to apply fundamentals of event delegation by adding a method to handle all clicks. For instance, an event listener could be added to the root element (or one if child its child ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
4 votes

Calling a global popup from nested vue components

Global Event Bus is a solution but since you have to listen emits in components's mounted or created lifecycle hook, it's getting duplicated in each instance. I had same 'issue' and resolved it by ...
Tugay İlik's user avatar
4 votes
Accepted

Display and search through a JSON's items in Vue.js

Overall the code looks fine. There aren't any drastic changes I would advise - just mostly a few simplifications. As far as the design goes it looks good, though it may be wise to add a spinner icon ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
4 votes
Accepted

Slots and Dynamic Components

Your code is overall very neat and clean and easily readable, I think you're ready for the next level! This switch maps from one string to another: ...
Simon Forsberg's user avatar
4 votes
Accepted

Passing a callback to a component in Vue.js

Your question so I've passed a callback to it. Is this okay in Vue or is there any other preferred way of structuring things like this? If you haven't already, I would suggest you read the VueJS ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
4 votes
Accepted

Remove excessive recurrent code from store and computed

DRY the code The 3 store getters are identical apart from the filter value. So first thing is to remove the repeated code. Create a function (either in the store, or within its scope, that you pass ...
Blindman67's user avatar
  • 22.2k
4 votes

Vue.js search functionality

As already mentioned, the code is ok, but if you want to make it cleaner by removing code duplication, you can introduce local variables and helper functions: ...
Bergi's user avatar
  • 1,545
4 votes

Structuring code logic for events on laravel controller

I'm mostly a back-end guy who fusses his way through front end code. Here's my advice: Keep the controller code as close as possible to handling the response only. Delegate the creation of objects to ...
Nick's user avatar
  • 141
4 votes

Vue.js checkout stepper

Is there any room for "shortening" the code? Shorthands Shorthands can simplify the markup. The click handlers already use the shorthand @click instead ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
4 votes
Accepted

Vue.js checkout stepper

Using step as a property inside each step is redundant and can lead to bugs if the value is incorrect. Consider what would happen if you had this: ...
Simon Forsberg's user avatar
4 votes
Accepted

Improving product configurator "algoritm"

The original Some comments on the code: ...
Blaž Mrak's user avatar
4 votes

Display properties of a country, from online service

Simplify Computed className is just lowercase continent name ...
depperm's user avatar
  • 937
4 votes
Accepted

Movies App with Vue 3 and TypeScript

This is feedback from me. You can create a directive named composite for outside click. In the movieCard component => you can replace template logic with computed properties. like for the date <...
Awais al-waissy's user avatar
4 votes
Accepted

v-for loop generating list items that will get rearranged based on an associated value (ranking system)

You don't need these: let count = 0; let increment = 0; let last_value = 0; let values_occurrence = {}; let sorted_values = []; Instead you should assign those ...
Simon Forsberg's user avatar
3 votes

Vue - It's the Royal Game of Ur

I have become more acquainted with ecmascript-6 since I gave the answer back in April, and realize now that because you are using ecmascript-6 features like const, <...
Sᴀᴍ Onᴇᴌᴀ's user avatar
3 votes
Accepted

Card based computer game

Disclaimer: I will slip into C# syntax from time to time, as I have little direct typescript experience. I'm focusing on the principle more than the actual syntax. Class abuse This is something ...
Flater's user avatar
  • 5,542
3 votes
Accepted

HTMLAudioElement sound delay on keyboard clicks

SFC Consider using Single File Components instead of the declarative syntax you are using right now. It removes a lot of the headache of dealing with the this ...
Sumurai8's user avatar
  • 2,595
3 votes
Accepted

Calling a global popup from nested vue components

Your solution seems to work and would not create unnecessary confusion for other developers (or yourself in six months). And even though Vuex seems overkill currently it may be beneficial later. One ...
AnotherGuy's user avatar
  • 1,094
3 votes

Dynamic List Application as first Vue.js App

Like I alluded to in my comment, I considered voting to close your question because point #8 looked like a request for help implementing code that doesn't work. Alas, I will review the working code. ...
Sᴀᴍ Onᴇᴌᴀ's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible