v-for=“新 in 旧”
<div id="app">
<ul>
<li v-for="(value, key) in object">
{{ key }} : {{ value }}
</li>
</ul>
</div>
export default {
data() {
return {
object: {
name: 'CSDN',
age: '18',
}
}
}
}
结果:
name : CSDN
age: 18