我有一个我的对象如下
$object_zero = {
'one' : 'one year',
'two' : 'two year',
'three' : 'there year',
'four' : 'four year',
'five' : 'five year',
'six' : 'six year',
'seven' : 'seven year',
'eight' : 'eight year',
};
Run Code Online (Sandbox Code Playgroud)
我有一个其他对象如下
$object = { 'one' : '1 Year', 'two' : '2 Year', 'three' : '3 Year', 'akta' : '12', 'mars' : '48' }
Run Code Online (Sandbox Code Playgroud)
我可以用 php 来完成,如下所示。
foreach($object_zero as $key => $val){
echo $object->$key;
}
Run Code Online (Sandbox Code Playgroud)
那么我该如何使用 vue.js 做到这一点呢?
我无法启动它。我的目标是只编写包含第一个对象的键的文本
<div v-for="(v, k, index) in …Run Code Online (Sandbox Code Playgroud)