Category Archives: Vue.Js Blog

Vue.js get screen height


We can use screen height property to get the total height of the screen. Here in this tutorial, we are going to explain how you can use screen height object to get the height of the screen. You can also use our online editor to edit and run the code online.


Vue.js get screen height Example

You can get screen height in vuejs simply as below-

Example:

{{result}}

Try it »

Output of above example-

vue.js get screen height

Vue.js string repeat


Sometimes we need to repeat string upto certain times, we can use JavaScript repeat() function to repeat string. Here in this tutorial, we are going to explain how you can use this function to repeat string in Vuejs.You can use the same method to repeat element/character in VueJs. You can use our online editor to edit and run the code online.


Vue.js string repeat Example

You repeat string in vue.js simply as below-

Example:

 

{{myStr}}

{{result}}

Try it »

Output of above example-

Vue.js string repeat

Vue.js string search


JavaScript search() method is used to search a value in a string. Here in this tutorial, we are going to explain how you can use this method to search a value in string in vuejs. You can use our online editor to edit and run the code online.


Vue.js string search Vuejs JavaScript Example

Here is an example of search method in vuejs –

Example:

{{myStr}}

{{result}}

Try it »

If value is found in string then it will return the position of value else it will return -1.

Output of above example-

Vue.js convert string to uppercase


We can use native JavaScript function to convert string to uppercase. JavaScript function toUpperCase() is used to convert a string to Uppercase. Here in this tutorial, we are going to explain how you can use this function is vuejs. You can use our online editor to edit and run the code online.


Vue.js convert string to uppercase Example

You can convert string to uppercase simply as below-

Example:

{{myStr}}

{{myStr2}}

Try it »

Output of above example-

Vue.js convert string to uppercase

Vue.js convert string to lowercase


We can use native javascript function to convert string to lowercase. Here in this article we are going to explain how you can use toLowerCase() function to convert string to lower case. You can also use our online editor to edit and run the code online.


Vue.js convert string to lowercase Example

You can convert string to lower case simply as below-

Example:

{{myStr}}

{{myStr2}}

Try it »

Output of above example-

Vue.js convert string to lowercase Example

Vue.js check valid date


We can create simple function to check valid date in vue.js. Here in this tutorial, we are going to explain how you can create custom function to validate date in vuejs. You can also use our online editor to edit and run the code online.


Vue.js check valid date Example

You can chec valid date in vuejs simply as below –

Example:

{{msg1}}

{{msg2}}

Try it »

Output of above example-

Vue.js check valid date

Vue.js Change Image src


Sometimes we need to change the image url dynamically in vue.js. It is very simple to change image src using dynamic variable. Here in this tutorial, we are going to explain how you can change the image url in Vue.js. You can also use our online editor to edit and run the code online.


Vue.js Change Image src | Url Example

You can change image src in vue.js simply as below-

Example:

{{image1}}


Try it »

Output of above example-

Vue.js Change Image src

Vue.js remove Array item By Value


We can remove array item by value using the indexof item. Here in this tutorial, we are going to explain how you can remove item by value in vue.js. In this tutorial we are going to create an array in which we will remove item by specified value ie element. You can also use our online editor to edit and run the code online.


Vue.js remove Array item By Value Example

Here is an example to remove an element by value from an array-

Example:

{{myArray}}

Click to Remove "Banana"

Try it »

Output of above example-

Vue.js remove Array item By Value

Vue.js get Array Last Item


We can get array last item in using index of last item. We can use length of array to get the last item. Here in this article, we are going to explain how you can get the last item from vuejs array. You can also use our online editor to edit and run the code online.


Vue.js get Array Last Item Example

You can get last item from array or object in vuejs simply as below-

Example:


Try it »

Output of above example-

Vue.js get Array Last Item From Object