Skip to content
Advertisement

Tag: vue.js

Vue dynamic background image inline component

I’m building a banner with Vue that needs to have a dynamic background, however, it doesn’t seem to be working. Not sure what I’m doing wrong. I’ve tried a few other ways and it works if I do an image tag something like But obviously this needs to be an inline background image. Code: component View Answer Looks like you’ve

t[this.activeSeriesIndex].data[0] is undefined in ApexCharts. How to correctly build the series array?

I’m a beginner in Vue and I’m using vue-apex chart to create a chart in my application. I want to display in chart, the values of the two component’s properties “uncorrectAns” and “correctAns” that I compute thanks to a specific method (computeStat()). When I run the application, the chart isn’t displayed and I get this error message on the browser

Issue with splitting string with line break in vue

So I’m trying to set a filter to replace a hyphen with a <br> to spit it onto a new line. I’ve created a filter like this: And then However, this just prints the </br> instead of breaking the line. I’m new to vue so not sure what I’m doing wrong? Answer The problem is not with your filter. It’s

How do you conditional bind v-model in Vue?

In JavaScript, object can optional spread value like this: In React, JSX can optional pass props like this: Now in Vue, how do I achieve optional v-model? I have a textarea like this How can I achieve optional bind v-model? I want to do this because I want to show warning on that textarea when error occurs. When error occurs,

Vuetify dynamic height for v-img

I have a container that is not 100% height of the page, it is 80% plus 60px on top and on bottom. So the image inside should inherit the height of the container. Using the <img /> and a little of CSS it is easy to achieve but I wish to add a template with loading spinner and so I

Vue method not returning value

I’m currently working with Vue, I have a method that is suppose to return a string which is displayed in a <span>. When I console.log the value I’m able to get the correct value however is not being passed into the span tag. From the above code snippet you can see that I am returning a value tag. return tag

Advertisement