提交 3337540c 编写于 作者: H hdx

feat: add v-for-v-for

上级 0badb02b
......@@ -35,6 +35,12 @@
"navigationBarTitleText": "v-for-item-v-show"
}
},
{
"path": "pages/directive/v-for/v-for-v-for",
"style": {
"navigationBarTitleText": "v-for-v-for"
}
},
{
"path": "pages/directive/v-if/v-if",
"style": {
......
const PAGE_PATH = '/pages/directive/v-for/v-for-v-for'
describe('v-for-v-for', () => {
let page
beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(500)
})
it('item1.item1', async () => {
const item_item = await page.$('.list-item-item')
expect(await item_item.text()).toBe('item1.item1')
})
})
<template>
<view class="page">
<view class="split-title">list items</view>
<view v-for="item in items">
<view class="list-item">{{ item.text }}</view>
<view v-for="item2 in item.items">
<view class="list-item-item">{{ item2.text }}</view>
</view>
</view>
</view>
</template>
<script lang="ts">
type ListItem = {
text : string,
items : ListItem[]
}
export default {
data() {
return {
items: [
{
text: 'item1',
items: [
{
text: 'item1.item1',
items: [] as ListItem[]
},
] as ListItem[]
},
] as ListItem[],
}
}
}
</script>
<style>
</style>
\ No newline at end of file
......@@ -80,6 +80,11 @@
url: 'v-for/v-for-item-v-show',
enable: true
},
{
name: 'v-for-v-for',
url: 'v-for/v-for-v-for',
enable: true
},
{
name: 'v-if',
url: 'v-if',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册