提交 52c485c7 编写于 作者: H hdx

feat(v-for): 新增 UTSJSONObject

上级 549e944a
......@@ -78,6 +78,15 @@
<view class="mb-10" v-for="(item, index) in setList" :key="index">
<text :id="`set-value-${index + 1}`">{{ item }}</text>
</view>
<view class="bold mb-10">v-for UTSJSONObject</view>
<view
v-for="(value, key) in utsJSONObject"
:key="key"
class="mb-10 flex justify-between flex-row">
<text :id="key">{{ key }}</text>
<text :id="value">{{ value }}</text>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
......@@ -134,4 +143,6 @@ const mapList = new Map<string, string>([
])
const setList = new Set<string>(['set value 1', 'set value 2', 'set value 3'])
const utsJSONObject = reactive({ utsKey1: 'UTSJSONObject-value1', utsKey2: 'UTSJSONObject-value2', utsKey3: 'UTSJSONObject-value3' })
</script>
......@@ -78,6 +78,15 @@
<view class="mb-10" v-for="(item, index) in setList" :key="index">
<text :id="`set-value-${index + 1}`">{{ item }}</text>
</view>
<view class="bold mb-10">v-for UTSJSONObject</view>
<view
v-for="(value, key) in utsJSONObject"
:key="key"
class="mb-10 flex justify-between flex-row">
<text :id="key">{{ key }}</text>
<text :id="value">{{ value }}</text>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
......@@ -135,6 +144,7 @@ export default {
['map-key-3', 'map value 3'],
]),
setList: new Set<string>(['set value 1', 'set value 2', 'set value 3']),
utsJSONObject: { utsKey1: 'UTSJSONObject-value1', utsKey2: 'UTSJSONObject-value2', utsKey3: 'UTSJSONObject-value3' }
}
}
}
......
......@@ -47,6 +47,16 @@ describe('v-for', () => {
const setValue3 = await page.$('#set-value-3')
expect(await setValue3.text()).toBe('set value 3')
// v-for UTSJSONObject
for (let i = 1; i <= 3; i++) {
/// key
let utsKey = await page.$('#utsKey' + i)
expect(await utsKey.text()).toBe('utsKey' + i)
/// value
let utsValue = await page.$('#UTSJSONObject-value' + i)
expect(await utsValue.text()).toBe('UTSJSONObject-value' + i)
}
await page.waitFor(500)
const image = await program.screenshot({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册