const json = JSON.parse(JSON.stringify(options).replace(/name/g,"label"));
注:
1、options是需要更改屬性的對象
2、replace(/name/g,"label") ,將對象里所有屬性為name的都修改成label
const json = JSON.parse(JSON.stringify(options).replace(/name/g,"label"));
注:
1、options是需要更改屬性的對象
2、replace(/name/g,"label") ,將對象里所有屬性為name的都修改成label
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。