提交 0d1ea412 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test(v-bind): 补充 object prop 测试

上级 11a1b744
......@@ -2,6 +2,7 @@
<view>
<text class="count-id">{{id}}</text>
<text class="count-title">{{title}}</text>
<text class="count-obj">{{obj!['name']}}</text>
</view>
</template>
......@@ -15,7 +16,10 @@
title: {
type: String,
default: ''
}
},
obj: {
type: Object as PropType<UTSJSONObject>
}
}
}
</script>
\ No newline at end of file
......@@ -9,8 +9,10 @@ describe('v-bind-props', () => {
it('counter1', async () => {
const counter = await page.$('.counter1')
const counterID = await counter.$('.count-id')
const counterTitle = await counter.$('.count-title')
expect(await counterID.text()).toBe('1')
const counterTitle = await counter.$('.count-title')
expect(await counterTitle.text()).toBe('title')
const counterObj = await counter.$('.count-obj')
expect(await counterObj.text()).toBe('obj prop name')
})
})
\ No newline at end of file
<template>
<view class="page">
<view class="split-title">v-bind-props</view>
<counter class="counter1" :id="post.id" :title="post.title"></counter>
<counter class="counter1" :id="post.id" :title="post.title" :obj="{name: 'obj prop name'}"></counter>
<!-- TODO 暂不支持 -->
<!-- <counter class="counter2" v-bind="post"></counter> -->
</view>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册