您现在的位置是:首页 > Javascript
当前栏目
Vue中使用XML和JSON格式互转插件
2023-02-18 16:35:59 时间
1.安装依赖
npm install x2js
2.在入口函数中引入并挂载到原型
import x2js from 'x2js'
Vue.prototype.$x2js = new x2js()
3.使用方法
//xml转json
this.$x2js.xml2js()
//json转xml
this.$x2js.js2xml()