Answers for "array to string vue"

0

array to string vue

<div id="app">
	<p>item 1 = {{ item1 }}</p>
	<p>Result = {{result}}</p>

	<button @click="myFunction()">Click Me</button>
</div>
<script>
 new Vue({
el: '#app',
  
  data: { 
	  item1:['12', '10', '9','5', '6', '4'],
	  result:''
  },
  
   methods:{
    myFunction: function () {		
		this.result = this.item1.join();	
    }
	}

});
</script>
Posted by: Guest on June-15-2021

Browse Popular Code Answers by Language