Requirements:

Click to expand all, show all the data

By default, four pieces of data are displayed

Ideas:

To get the data

Determine the length of the array, if greater than 4, cut the first 4 data to assign values to partData, allData to allData, isShowAll(control expansion of all text show and hide) set to true

If not, assign data to partData, isShowAll unchanged, default false

Next up is rendering

Render the partData data directly

Define the toggleData event and assign allData data to partData if you click to expand all (isShowAll is false)