vue.js中数组,字符串互转

数组=》字符串

ar  authority= ['1','2'];

let permission = authority.join(",");
console.log(permission )//1,2
字符串=》数组
var a='1,2'
a.split(',')
console.log(a)// ["1", "2"]
posted @ 2022-03-02 22:34  Chiffon1996  阅读(209)  评论(0编辑  收藏  举报