• base::

    解析数组

    const products = [
      { title: 'Cabbage', id: 1 },
      { title: 'Garlic', id: 2 },
      { title: 'Apple', id: 3 },
    ];

    Inside your component, use the map() function to transform an array of products into an array of <li> items:

    const listItems = products.map(product =>
      <li key={product.id}>
        {product.title}
      </li>
    );
    return (
      <ul>{listItems}</ul>
    );
    指向原始笔记的链接
  • 与vue一样,需要一个Vue key属性
    • it should be considered a different Chat component that needs to be re-created