How does vue intercept and display array data?

<div v-for="(item, index) in cMList" :key=index>
  
  
  <div v-for="(items, indexs) in item.list" :key=indexs>
    {{items.content}}  // 
  </div>
</div

above, I can output all the data, but now I just want it to output the first three pieces of data. I changed it to
vmurf = "(items, indexs) in item.list.slice (0,2)"
but misreported TypeError: Cannot read property "slice" of undefined "
Why?

cMList: [
  {
    uid: 10001,
    list: [
        {nickname: "aaa", content: "666", time: "2019.2.12"},
        {nickname: "aaa", content: "666", time: "2019.2.12"},
        {nickname: "aaa", content: "666", time: "2019.2.12"},
        {nickname: "aaa", content: "666", time: "2019.2.12"},
        {nickname: "aaa", content: "666", time: "2019.2.12"},
        {nickname: "aaa", content: "666", time: "2019.2.12"},
        {nickname: "aaa", content: "666", time: "2019.2.12"}
    ]
  }
]
Jun.15,2022

you wrote it wrong.

  

it is still not recommended to write processing logic in the template. After you get the data, process it into three pieces, and then output it, so that the logic is clearer.

Menu