未验证 提交 3bf85772 编写于 作者: Q qiang 提交者: GitHub

fix(dialog): 标题判断时未考虑插槽 (#1601)

上级 1a20611c
......@@ -38,6 +38,17 @@ test('should render dialog template', async () => {
expect(await overLay.find('.nut-dialog__content'));
});
test('header slot', async () => {
const wrapper = mount(DialogTemplate, {
slots: {
header: 'test-title'
}
});
const overLay = wrapper.getComponent(OverLay);
expect(await overLay.find('.nut-dialog__header'));
});
// test('should render dialog methods', async () => {
// Dialog({
// title: '基础弹框',
......
......@@ -13,7 +13,7 @@
@click-close-icon="closed"
>
<view :class="classes">
<view v-if="title" class="nut-dialog__header">
<view v-if="$slots.header || title" class="nut-dialog__header">
<slot v-if="$slots.header" name="header"></slot>
<template v-else>{{ title }}</template>
</view>
......
......@@ -13,7 +13,7 @@
@click-close-icon="closed"
>
<view :class="classes">
<view v-if="title" class="nut-dialog__header">
<view v-if="$slots.header || title" class="nut-dialog__header">
<slot v-if="$slots.header" name="header"></slot>
<template v-else>{{ title }}</template>
</view>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册