feat(Picker): add allow-html prop (#4278)

This commit is contained in:
neverland
2019-08-28 20:58:50 +08:00
committed by GitHub
parent 93ef02c409
commit 667c4f692c
7 changed files with 70 additions and 22 deletions
@@ -28,6 +28,22 @@ exports[`column watch default index 2`] = `
</div>
`;
exports[`not allow html 1`] = `
<div class="van-picker">
<!---->
<div class="van-picker__columns" style="height: 220px;">
<div class="van-picker-column">
<ul class="van-picker-column__wrapper" style="transform: translate3d(0, 88px, 0); transition-duration: 0ms; transition-property: none; line-height: 44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected" style="height: 44px;">&lt;div&gt;option&lt;/div&gt;</li>
</ul>
</div>
<div class="van-picker__mask" style="background-size: 100% 88px;"></div>
<div class="van-hairline-unset--top-bottom van-picker__frame" style="height: 44px;"></div>
</div>
<!---->
</div>
`;
exports[`render title slot 1`] = `
<div class="van-picker">
<div class="van-hairline--top-bottom van-picker__toolbar">
+11
View File
@@ -195,3 +195,14 @@ test('toolbar-position prop', () => {
expect(wrapper).toMatchSnapshot();
});
test('not allow html', () => {
const wrapper = mount(Picker, {
propsData: {
allowHtml: false,
columns: ['<div>option</div>']
}
});
expect(wrapper).toMatchSnapshot();
});