代码示例:
let id = 0 const todos = ref([ { id: id++, text: 'Learn HTML' }, { id: id++, text: 'Learn JavaScript' }, { id: id++, text: 'Learn Vue' } ])控制台:
id是递增的,而不是一样的。
标签:自增,示例,++,text,Learn,id From: https://www.cnblogs.com/huguo/p/17043456.html
代码示例:
let id = 0 const todos = ref([ { id: id++, text: 'Learn HTML' }, { id: id++, text: 'Learn JavaScript' }, { id: id++, text: 'Learn Vue' } ])控制台:
id是递增的,而不是一样的。
标签:自增,示例,++,text,Learn,id From: https://www.cnblogs.com/huguo/p/17043456.html