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:
<div id="app"> <p>{{myStr}}</p> <p>{{result}}</p> <button>Click Me</button> </div> |
Output of above example-