Tutorialsplane

Vue.Js Convert string to Array


We can use native JavaScript split() method to convert string to array in vue.js. Here in this tutorial, we are going to explain how you can convert a string to Array in Vue.js.


Vue.Js Convert string to Array JavScript Example

Here is an example of split method in Vue.js-

Example:

<pre>



 


<div id="app">
	<p>String = {{ str }}</p>
	<p>Array = {{result}}</p>
	<button>Click Me</button>
</div>
        

                                                        

Try it ยป

Output of above example-