fix(components): [result] rename slot's name from 'subTitle' to 'sub-title' (#6636)

* fix(components): [result] rename slot's name

* docs(components): [result] update doc
This commit is contained in:
blackie 2022-03-15 16:59:50 +08:00 committed by GitHub
parent 52e389a058
commit 458e301a52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -33,9 +33,9 @@ result/customized-content
## Result Slots
| Name | Description |
| -------- | ----------------- |
| icon | custom icon |
| title | custom title |
| subTitle | custom sub title |
| extra | custom extra area |
| Name | Description |
| --------- | ----------------- |
| icon | custom icon |
| title | custom title |
| sub-title | custom sub title |
| extra | custom extra area |

View File

@ -85,7 +85,7 @@ describe('Result.vue', () => {
test('should render sub-title slots', () => {
const wrapper = mount({
slots: {
subTitle: AXIOM,
'sub-title': AXIOM,
},
})
expect(wrapper.find('.el-result__subtitle').exists()).toBe(true)

View File

@ -14,8 +14,8 @@
<p>{{ title }}</p>
</slot>
</div>
<div v-if="subTitle || $slots.subTitle" :class="ns.e('subtitle')">
<slot name="subTitle">
<div v-if="subTitle || $slots['sub-title']" :class="ns.e('subtitle')">
<slot name="sub-title">
<p>{{ subTitle }}</p>
</slot>
</div>