2020-08-13 15:18:26 +08:00
|
|
|
## PageHeader
|
|
|
|
|
2021-04-25 21:17:39 +08:00
|
|
|
If path of the page is simple, it is recommended to use PageHeader instead of the Breadcrumb.
|
2020-08-13 15:18:26 +08:00
|
|
|
|
2021-04-25 21:17:39 +08:00
|
|
|
### Basic usage
|
2020-08-13 15:18:26 +08:00
|
|
|
|
|
|
|
:::demo
|
2021-09-04 19:29:28 +08:00
|
|
|
|
2020-08-13 15:18:26 +08:00
|
|
|
```html
|
2021-09-04 19:29:28 +08:00
|
|
|
<el-page-header @back="goBack" content="detail"> </el-page-header>
|
2020-08-13 15:18:26 +08:00
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
methods: {
|
|
|
|
goBack() {
|
2021-09-04 19:29:28 +08:00
|
|
|
console.log('go back')
|
|
|
|
},
|
|
|
|
},
|
2020-08-13 15:18:26 +08:00
|
|
|
}
|
|
|
|
</script>
|
2021-06-25 16:09:15 +08:00
|
|
|
<!--
|
|
|
|
<setup>
|
|
|
|
|
|
|
|
import { defineComponent } from 'vue';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
setup() {
|
|
|
|
const goBack = () => {
|
|
|
|
console.log('go back');
|
|
|
|
};
|
|
|
|
|
|
|
|
return {
|
|
|
|
goBack,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
</setup>
|
|
|
|
-->
|
2020-08-13 15:18:26 +08:00
|
|
|
```
|
2021-09-04 19:29:28 +08:00
|
|
|
|
2020-08-13 15:18:26 +08:00
|
|
|
:::
|
|
|
|
|
2021-04-25 21:17:39 +08:00
|
|
|
### Custom icon
|
|
|
|
|
|
|
|
:::demo
|
2021-09-04 19:29:28 +08:00
|
|
|
|
2021-04-25 21:17:39 +08:00
|
|
|
```html
|
|
|
|
<el-page-header icon="el-icon-arrow-left" content="detail"></el-page-header>
|
|
|
|
```
|
2021-09-04 19:29:28 +08:00
|
|
|
|
2021-04-25 21:17:39 +08:00
|
|
|
:::
|
|
|
|
|
|
|
|
### Attributes
|
2021-09-04 19:29:28 +08:00
|
|
|
|
|
|
|
| Attribute | Description | Type | Accepted Values | Default |
|
|
|
|
| --------- | ----------- | ------ | --------------- | ------------ |
|
|
|
|
| icon | icon | string | — | el-icon-back |
|
|
|
|
| title | main title | string | — | Back |
|
|
|
|
| content | content | string | — | — |
|
2020-08-13 15:18:26 +08:00
|
|
|
|
2021-04-25 21:17:39 +08:00
|
|
|
### Events
|
2021-09-04 19:29:28 +08:00
|
|
|
|
|
|
|
| Event Name | Description | Parameters |
|
|
|
|
| ---------- | ----------------------------------- | ---------- |
|
|
|
|
| back | triggers when right side is clicked | — |
|
2020-08-13 15:18:26 +08:00
|
|
|
|
|
|
|
### Slots
|
2021-09-04 19:29:28 +08:00
|
|
|
|
|
|
|
| Name | Description |
|
|
|
|
| ------- | ------------- |
|
|
|
|
| icon | custom icon |
|
|
|
|
| title | title content |
|
|
|
|
| content | content |
|