提交 6d9db730 编写于 作者: 辛宝Otto's avatar 辛宝Otto 🥊 提交者: 辛宝Otto

feat: rich-text 默认添加 click ,父容器相应 click 事件

上级 7b2a3764
......@@ -55,4 +55,12 @@ describe('rich-text-test', () => {
});
});
it('rich-text parent click', async () => {
const element = await page.$('#rich-text-parent')
await element.tap()
await page.waitFor(500)
const element2 = await page.$('#rich-text-str')
expect(await element2.text()).toBe("true")
})
})
......@@ -16,9 +16,13 @@
<text class="uni-subtitle-text">selectable</text>
<button type="default" @click="changeText">修改文本内容</button>
</view>
<view class="text-box">
<view class="text-box" id="rich-text-parent" @click="richTextParentClick">
<rich-text id="richtext" style="border: 1px; border-style: solid; border-color: red;" :selectable="true"
:nodes="text"></rich-text>
<view>
<text>rich-text-parent</text>
<text id='rich-text-str'>{{richTextStr}}</text>
</view>
</view>
</view>
</view>
......@@ -35,7 +39,8 @@
// 自动化测试
autoTest: false,
testNodes: '<img src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png"></img>',
isItemClickTrigger: false
isItemClickTrigger: false,
richTextStr: false
}
},
onReady() {
......@@ -71,6 +76,9 @@
},
getWindowInfoForTest() : GetWindowInfoResult {
return uni.getWindowInfo();
},
richTextParentClick() {
this.richTextStr = true;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册