安装插件:
npm install --save base-64
使用:
<script>
import Base64 from 'base-64';
export default {
data(){
return{
}
},
mounted(){
let str = '123456'
let str2 = Base64.encode(str)//加密
let str3 = Base64.decode(str2)//接密
console.log(str2,str3)
}
}
</script>