js 使用replace替换正反斜杠

正斜杠转成反斜杠

let a = 'https://editor/csdn/net'
let b = a.replace(/\//g,'\\')   // https:\\editor\csdn\net


你可能感兴趣的:(js,javascript,html,vue.js)