I am using vue to display data , here is my html now i have this in computed: and in my methods i have this and now here are some of the things i have issues with, when i loop over the values, my data is not visible, i can see the call to the API which returns me the
Category: Questions
Append inside a child difficulties
This is my current situation. I got one parent called “box” which got 15 childrens inside called item. Then I got a loop where I append some text that should be inside the children div. If I append it directly inside the children the code gets messed up and I get the 15 things I want to inside in …
target child div of ID in JavaScript and CSS
I’m having difficulty targeting the child div of id=”videoContainer” and changing its style Answer You can use querySelector with the direct child operator > (and maybe first with :first-child if you have more than one child div) like this: object-fit: contain will force you video to scal…
How to make the FAQ accordion toggle?
I’m trying to make an FAQ accordion and I want it to have two main features: 1- one question and answer can be seen at a time (I managed to do that) 2- if toggling on the open question it closes, and vice-versa (that’s what i’m struggling with) Here’s a pen that has a small copy of wha…
Vitest mock modules function in only one test and use the actual function in others
The following is an abstraction of my problem and thus does not make too much sense: Given I have a simple utility callMethodIf that’s returning the return of another imported method (blackbox). ~~/utils/call-method-if.js: ~~/utils/blackbox.js: How would I run one test case which calls the actual implem…
“Slots” prop does nothing when applied on material-ui Slider component
I am trying to figure out what “slots” prop has to offer to the Slider component in terms of taking control of inner components rendering (track, thumb, etc). I am rendering a simple Slider component as shown below However, not even this simple example is working for me. “Slots” prop i…
How to remove Label from charts.js
I am using charts.js to create a charts for my website. I am unable the remove the legend from the chart. I did not found the solution. This is the first time I am using charts.js library. code: }); Thanks in advance. Answer Here is the documentation https://www.chartjs.org/docs/latest/configuration/legend.ht…
Getting JavaScript file from Google Sheets
In my google sheet I entered below formulas in B1 and B2 Then these Cells become valid JS statements name = ‘Prabhu Paul’ ; and city = ‘India’ ; Then I published the Sheet in .csv format, below is the URL. And now I used this URL as the source file for my Script. The script added to si…
Swiper Js Slider – Images overlapping in fixed height slider
Desire output: I am trying to implement a slider with a fixed height and auto width. The images should be adjusted to e.g. height: 800px and the width should be true to the image resolution. My Implementation: https://playground-f2831f.webflow.io/model-images/provident-at-sunt-incidunt How it is supposed to b…
converting an array into object in typescript
I have an array of objects: Where I need to convert it to the type NFCollection which looks so: The result should looks like this: where the data includes only those persons whose age >= 18. So I could start writing something like: but then I would like to convert it to the NFCollection type. How would I d…