Vue將xml格式轉爲json (x2js.js)

1.npm安裝x2js npm i x2js(報錯的話下面有解決方法) 2.全局掛載main.js import x2js from ‘x2js’ //xml數據處理插件 Vue.prototype.$x2js = new x2js() //全局方法掛載 3.使用  var jsonObj = this.$x2js.xml2js(res);//res (xml數據) console.log(jso
相關文章
相關標籤/搜索