feat(Picker): add confirm、cancel slot (#7377)

This commit is contained in:
neverland
2020-10-21 18:27:24 +08:00
committed by GitHub
parent 83095c7d1e
commit dabd984070
5 changed files with 64 additions and 27 deletions
+15 -5
View File
@@ -138,13 +138,23 @@ test('column watch default index', async () => {
test('render title slot', () => {
const wrapper = mount({
template: `
<picker show-toolbar>
<van-picker show-toolbar>
<template v-slot:title>Custom title</template>
</picker>
</van-picker>
`,
});
expect(wrapper).toMatchSnapshot();
});
test('render confirm/cancel slot', () => {
const wrapper = mount({
template: `
<van-picker show-toolbar>
<template v-slot:confirm>Custom Confirm</template>
<template v-slot:cancel>Custom Cancel</template>
</van-picker>
`,
components: {
Picker,
},
});
expect(wrapper).toMatchSnapshot();