diff --git a/pages/directive/v-for/v-for-composition.uvue b/pages/directive/v-for/v-for-composition.uvue
index 23edf419a54b112380cd7aedeaa898d97a242066..bc45db13d457d1798075e3e26af292537f0a35aa 100644
--- a/pages/directive/v-for/v-for-composition.uvue
+++ b/pages/directive/v-for/v-for-composition.uvue
@@ -18,7 +18,10 @@
v-for & v-if list items
-
+
{{ item.name }}
@@ -63,6 +66,18 @@
}}
+
+
+ {{ item[0] }}
+ {{ item[1] }}
+
+
+
+ {{ item }}
+
@@ -111,4 +126,12 @@ const listItems = ref([
]
},
] as ListItem[])
+
+const mapList = new Map([
+ ['map-key-1', 'map value 1'],
+ ['map-key-2', 'map value 2'],
+ ['map-key-3', 'map value 3'],
+])
+
+const setList = new Set(['set value 1', 'set value 2', 'set value 3'])
diff --git a/pages/directive/v-for/v-for-options.uvue b/pages/directive/v-for/v-for-options.uvue
index f96d52e2b573f7390f86cfe1d4b948bd83695f35..f77577f0255a1e0a479fc81ad81ad98db64514eb 100644
--- a/pages/directive/v-for/v-for-options.uvue
+++ b/pages/directive/v-for/v-for-options.uvue
@@ -66,6 +66,18 @@
}}
+
+
+ {{ item[0] }}
+ {{ item[1] }}
+
+
+
+ {{ item }}
+
@@ -86,6 +98,7 @@ type ListItem = {
items?: ListItem[]
}
+// TODO: v-for map set deep array 动态增加删除
export default {
data() {
return {
@@ -116,6 +129,12 @@ export default {
]
},
] as ListItem[],
+ mapList: new Map([
+ ['map-key-1', 'map value 1'],
+ ['map-key-2', 'map value 2'],
+ ['map-key-3', 'map value 3'],
+ ]),
+ setList: new Set(['set value 1', 'set value 2', 'set value 3']),
}
}
}
diff --git a/pages/directive/v-for/v-for.test.js b/pages/directive/v-for/v-for.test.js
index ccffa97fd24fa58a814609ea8a5c4685d1c47018..138acdd084baa63b497b57e6d2bddc78f169912d 100644
--- a/pages/directive/v-for/v-for.test.js
+++ b/pages/directive/v-for/v-for.test.js
@@ -33,6 +33,20 @@ describe('v-for', () => {
await vShow1Count.tap()
expect(await vShow1Count.text()).toBe('2')
+ const mapValue1 = await page.$('#map-key-1')
+ expect(await mapValue1.text()).toBe('map value 1')
+ const mapValue2 = await page.$('#map-key-2')
+ expect(await mapValue2.text()).toBe('map value 2')
+ const mapValue3 = await page.$('#map-key-3')
+ expect(await mapValue3.text()).toBe('map value 3')
+
+ const setValue1 = await page.$('#set-value-1')
+ expect(await setValue1.text()).toBe('set value 1')
+ const setValue2 = await page.$('#set-value-2')
+ expect(await setValue2.text()).toBe('set value 2')
+ const setValue3 = await page.$('#set-value-3')
+ expect(await setValue3.text()).toBe('set value 3')
+
await page.waitFor(500)
const image = await program.screenshot({