The front end receives the json string and handles the loss of id precision after converting it to an array

1. Install  the json-bigint plugin

npm install json-bigint

2. Introduce in the used page

import jsonBigint from 'json-bigint';

3. Convert after receiving the data

const json = jsonBigint({
   storeAsString: true
})
this.list = json.parse(res)
console.log(this.list ,'转换后的数据')

The test works! ! !

Guess you like

Origin blog.csdn.net/qq_38543537/article/details/130100745