vue循環語句

迭代數組:

v-for="site in sites”,sites表示源數組名,site表示數組元素;

迭代對象:

v-for=“value in Object”,

v-for="(value,key) in Object"

v-for="(value,key,index) in Object"

一定要是這個順序,第二個只為key,第三個值為index,換了名字,也是按照這個順序返回;

迭代整數:

v-for="n in 10"

循環語句將數據從數組渲染到一個列表。

猜你喜欢

转载自www.cnblogs.com/Zhengxiaoxiao/p/10515851.html