From 52c485c7f89d6b7b048fd46135e82292a586467e Mon Sep 17 00:00:00 2001 From: hdx Date: Sat, 11 May 2024 14:08:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(v-for):=20=E6=96=B0=E5=A2=9E=20UTSJSONObje?= =?UTF-8?q?ct?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/directive/v-for/v-for-composition.uvue | 13 ++++++++++++- pages/directive/v-for/v-for-options.uvue | 12 +++++++++++- pages/directive/v-for/v-for.test.js | 14 ++++++++++++-- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/pages/directive/v-for/v-for-composition.uvue b/pages/directive/v-for/v-for-composition.uvue index bc45db1..926a618 100644 --- a/pages/directive/v-for/v-for-composition.uvue +++ b/pages/directive/v-for/v-for-composition.uvue @@ -77,6 +77,15 @@ {{ item }} + + + v-for UTSJSONObject + + {{ key }} + {{ value }} @@ -133,5 +142,7 @@ const mapList = new Map([ ['map-key-3', 'map value 3'], ]) -const setList = new Set(['set value 1', 'set value 2', 'set value 3']) +const setList = new Set(['set value 1', 'set value 2', 'set value 3']) + +const utsJSONObject = reactive({ utsKey1: 'UTSJSONObject-value1', utsKey2: 'UTSJSONObject-value2', utsKey3: 'UTSJSONObject-value3' }) diff --git a/pages/directive/v-for/v-for-options.uvue b/pages/directive/v-for/v-for-options.uvue index f77577f..37b0446 100644 --- a/pages/directive/v-for/v-for-options.uvue +++ b/pages/directive/v-for/v-for-options.uvue @@ -77,6 +77,15 @@ {{ item }} + + + v-for UTSJSONObject + + {{ key }} + {{ value }} @@ -134,7 +143,8 @@ export default { ['map-key-2', 'map value 2'], ['map-key-3', 'map value 3'], ]), - setList: new Set(['set value 1', 'set value 2', 'set value 3']), + setList: new Set(['set value 1', 'set value 2', 'set value 3']), + utsJSONObject: { utsKey1: 'UTSJSONObject-value1', utsKey2: 'UTSJSONObject-value2', utsKey3: 'UTSJSONObject-value3' } } } } diff --git a/pages/directive/v-for/v-for.test.js b/pages/directive/v-for/v-for.test.js index 138acdd..8672925 100644 --- a/pages/directive/v-for/v-for.test.js +++ b/pages/directive/v-for/v-for.test.js @@ -46,9 +46,19 @@ describe('v-for', () => { expect(await setValue2.text()).toBe('set value 2') 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({ fullPage: true }); -- GitLab