Home >Web Front-end >Vue.js >How to convert array to string in vue.js
vue.js method to convert array to string: [var authority= ['1','2'];let permission = authority.join(",");console.log(permission )] .
The operating environment of this article: windows10 system, vue.js 2.9, thinkpad t480 computer.
vue.js implements mutual conversion between arrays and strings. The specific code is as follows:
Array to string
var authority= ['1','2']; let permission = authority.join(","); console.log(permission )//1,2
String to array
var a='1,2' a.split(',') console.log(a)// ["1", "2"]
Recommended learning: php training
The above is the detailed content of How to convert array to string in vue.js. For more information, please follow other related articles on the PHP Chinese website!