[new feature] Toast: add iconPrefix option (#3872)
This commit is contained in:
@@ -12,6 +12,13 @@ exports[`icon prop 1`] = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`icon-prefix prop 1`] = `
|
||||
<div class="van-toast van-toast--middle" style="z-index: 2005;" name="van-fade"><i class="my-icon my-icon-star-o van-toast__icon">
|
||||
<!----></i>
|
||||
<div class="van-toast__text">Message</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`show html toast 1`] = `
|
||||
<div class="van-toast van-toast--middle van-toast--text" style="z-index: 2003;" name="van-fade">
|
||||
<div class="van-toast__text">
|
||||
|
||||
@@ -60,6 +60,17 @@ test('icon prop', async () => {
|
||||
expect(toast.$el.outerHTML).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('icon-prefix prop', async () => {
|
||||
const toast = Toast({
|
||||
message: 'Message',
|
||||
icon: 'star-o',
|
||||
iconPrefix: 'my-icon'
|
||||
});
|
||||
|
||||
await later();
|
||||
expect(toast.$el.outerHTML).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('clear toast', () => {
|
||||
const toast1 = Toast();
|
||||
expect(toast1.value).toBeTruthy();
|
||||
|
||||
Reference in New Issue
Block a user