Skip to content

Commit

Permalink
update prop
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyoung committed May 27, 2019
1 parent 8260945 commit 20698fc
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 25 deletions.
10 changes: 5 additions & 5 deletions examples/docs/en-US/page-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ If path of the page is simple, it is recommended to use PageHeader instead of th

:::demo
```html
<el-page-header @back="goBack" title="back" sub-title="detail">
<el-page-header @back="goBack" content="detail">
</el-page-header>

<script>
Expand All @@ -18,14 +18,14 @@ If path of the page is simple, it is recommended to use PageHeader instead of th
}
}
</script>
```
```html
:::

### Attributes
| Attribute | Description | Type | Accepted Values | Default |
|---------- |-------------- |---------- |------------------------------ | ------ |
| title | main title | string || back |
| sub-title | sub title | string |||
| title | main title | string | — | Back |
| content | content | string | — | — |

### Events
| Event Name | Description | Parameters |
Expand All @@ -36,4 +36,4 @@ If path of the page is simple, it is recommended to use PageHeader instead of th
| slot | Description |
|---------- | ---------------------- |
| title | title content |
| subTitle | sub title content |
| content | content |
8 changes: 4 additions & 4 deletions examples/docs/es/page-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ If path of the page is simple, it is recommended to use PageHeader instead of th

:::demo
```html
<el-page-header @back="goBack" title="back" sub-title="detail">
<el-page-header @back="goBack" content="detail">
</el-page-header>

<script>
Expand All @@ -24,8 +24,8 @@ If path of the page is simple, it is recommended to use PageHeader instead of th
### Attributes
| Attribute | Description | Type | Accepted Values | Default |
|---------- |-------------- |---------- |------------------------------ | ------ |
| title | main title | string | — | back |
| sub-title | sub title | string | — | — |
| title | main title | string | — | Back |
| content | content | string | — | — |

### Events
| Event Name | Description | Parameters |
Expand All @@ -36,4 +36,4 @@ If path of the page is simple, it is recommended to use PageHeader instead of th
| slot | Description |
|---------- | ---------------------- |
| title | title content |
| subTitle | sub title content |
| content | content |
10 changes: 5 additions & 5 deletions examples/docs/fr-FR/page-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ If path of the page is simple, it is recommended to use PageHeader instead of th

:::demo
```html
<el-page-header @back="goBack" title="back" sub-title="detail">
<el-page-header @back="goBack" content="detail">
</el-page-header>

<script>
Expand All @@ -18,14 +18,14 @@ If path of the page is simple, it is recommended to use PageHeader instead of th
}
}
</script>
```
```html
:::

### Attributes
| Attribute | Description | Type | Accepted Values | Default |
|---------- |-------------- |---------- |------------------------------ | ------ |
| title | main title | string || back |
| sub-title | sub title | string |||
| title | main title | string | — | Back |
| content | content | string | — | — |

### Events
| Event Name | Description | Parameters |
Expand All @@ -36,4 +36,4 @@ If path of the page is simple, it is recommended to use PageHeader instead of th
| slot | Description |
|---------- | ---------------------- |
| title | title content |
| subTitle | sub title content |
| content | content |
6 changes: 3 additions & 3 deletions examples/docs/zh-CN/page-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

:::demo
```html
<el-page-header @back="goBack" title="返回" sub-title="详情页面">
<el-page-header @back="goBack" content="详情页面">
</el-page-header>

<script>
Expand All @@ -25,7 +25,7 @@
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------------- |---------- |------------------------------ | ------ |
| title | 标题 | string || 返回 |
| sub-title | 副标题 | string |||
| content | 内容 | string |||


### Events
Expand All @@ -37,4 +37,4 @@
| 事件名称 | 说明 |
|---------- |------------- |
| title | 标题内容 |
| subTitle | 副标题内容 |
| content | 内容 |
6 changes: 3 additions & 3 deletions packages/page-header/src/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<slot name="title">{{ title }}</slot>
</div>
</div>
<div class="el-page-header__subtitle">
<slot name="subTitle">{{ subTitle }}</slot>
<div class="el-page-header__content">
<slot name="content">{{ content }}</slot>
</div>
</div>
</template>
Expand All @@ -24,7 +24,7 @@ export default {
return t('el.pageHeader.title');
}
},
subTitle: String
content: String
}
};
</script>
2 changes: 1 addition & 1 deletion packages/theme-chalk/src/page-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}
}

@include e(subtitle) {
@include e(content) {
font-size: 18px;
color: $--color-text-primary;
}
Expand Down
3 changes: 1 addition & 2 deletions test/unit/specs/page-header.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ describe('PageHeader', () => {

it('render well and trigger back event', async() => {
vm = createVue(PageHeader, {
title: 'title',
subTitle: 'SubTitle'
content: 'content'
});
expect(vm.$el).to.exist;
const spy = sinon.spy();
Expand Down
4 changes: 2 additions & 2 deletions types/page-header.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export declare class ElPageHeader extends ElementUIComponent {
/** title */
title: String

/** sub title */
subTitle: String
/** content */
content: String
}

0 comments on commit 20698fc

Please sign in to comment.