Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
31d31d90
Commit
31d31d90
authored
Oct 20, 2018
by
Wenlu Wang
Committed by
hetech
Oct 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alert: add support for title slot (#13082)
* Alert: add support for title slot * update documents
parent
97728bdd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
1 deletion
+28
-1
examples/docs/en-US/alert.md
examples/docs/en-US/alert.md
+5
-0
examples/docs/es/alert.md
examples/docs/es/alert.md
+5
-0
examples/docs/zh-CN/alert.md
examples/docs/zh-CN/alert.md
+5
-0
packages/alert/src/main.vue
packages/alert/src/main.vue
+3
-1
test/unit/specs/alert.spec.js
test/unit/specs/alert.spec.js
+10
-0
No files found.
examples/docs/en-US/alert.md
View file @
31d31d90
...
@@ -216,6 +216,11 @@ Description includes a message with more detailed information.
...
@@ -216,6 +216,11 @@ Description includes a message with more detailed information.
| close-text | customized close button text | string | — | — |
| close-text | customized close button text | string | — | — |
| show-icon | if a type icon is displayed | boolean | — | false |
| show-icon | if a type icon is displayed | boolean | — | false |
### Slot
| Name | Description |
|------|--------|
| title | content of the Alert title |
### Events
### Events
| Event Name | Description | Parameters |
| Event Name | Description | Parameters |
...
...
examples/docs/es/alert.md
View file @
31d31d90
...
@@ -218,6 +218,11 @@ Descripción incluye un mensaje con información más detallada.
...
@@ -218,6 +218,11 @@ Descripción incluye un mensaje con información más detallada.
| close-text | texto de cerrado personalizado | string | — | — |
| close-text | texto de cerrado personalizado | string | — | — |
| show-icon | si un icono del tipo de alerta se debe mostrar | boolean | — | false |
| show-icon | si un icono del tipo de alerta se debe mostrar | boolean | — | false |
### Slot
| Name | Description |
|------|--------|
| title | El contenido del título de alerta. |
### Eventos
### Eventos
| Nombre del evento | Descripción | Parámetros |
| Nombre del evento | Descripción | Parámetros |
...
...
examples/docs/zh-CN/alert.md
View file @
31d31d90
...
@@ -210,6 +210,11 @@
...
@@ -210,6 +210,11 @@
| close-text | 关闭按钮自定义文本 | string | — | — |
| close-text | 关闭按钮自定义文本 | string | — | — |
| show-icon | 是否显示图标 | boolean | — | false |
| show-icon | 是否显示图标 | boolean | — | false |
### Slot
| Name | Description |
|------|--------|
| title | 标题的内容 |
### Events
### Events
| 事件名称 | 说明 | 回调参数 |
| 事件名称 | 说明 | 回调参数 |
...
...
packages/alert/src/main.vue
View file @
31d31d90
...
@@ -8,7 +8,9 @@
...
@@ -8,7 +8,9 @@
>
>
<i
class=
"el-alert__icon"
:class=
"[ iconClass, isBigIcon ]"
v-if=
"showIcon"
></i>
<i
class=
"el-alert__icon"
:class=
"[ iconClass, isBigIcon ]"
v-if=
"showIcon"
></i>
<div
class=
"el-alert__content"
>
<div
class=
"el-alert__content"
>
<span
class=
"el-alert__title"
:class=
"[ isBoldTitle ]"
v-if=
"title"
>
{{
title
}}
</span>
<span
class=
"el-alert__title"
:class=
"[ isBoldTitle ]"
v-if=
"title || $slots.title"
>
<slot
name=
"title"
>
{{
title
}}
</slot>
</span>
<slot>
<slot>
<p
class=
"el-alert__description"
v-if=
"description"
>
{{
description
}}
</p>
<p
class=
"el-alert__description"
v-if=
"description"
>
{{
description
}}
</p>
</slot>
</slot>
...
...
test/unit/specs/alert.spec.js
View file @
31d31d90
...
@@ -35,6 +35,16 @@ describe('Alert', () => {
...
@@ -35,6 +35,16 @@ describe('Alert', () => {
.
to
.
equal
(
'
Unbowed, Unbent, Unbroken
'
);
.
to
.
equal
(
'
Unbowed, Unbent, Unbroken
'
);
});
});
it
(
'
title slot
'
,
()
=>
{
vm
=
createVue
(
`
<el-alert>
<span slot="title">foo</span>
</el-alert>
`
);
expect
(
vm
.
$el
.
querySelector
(
'
.el-alert__title
'
).
textContent
).
to
.
equal
(
'
foo
'
);
});
it
(
'
close
'
,
()
=>
{
it
(
'
close
'
,
()
=>
{
vm
=
createVue
({
vm
=
createVue
({
template
:
`
template
:
`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment