2020-08-13 15:18:26 +08:00
|
|
|
## PageHeader 页头
|
|
|
|
|
|
|
|
如果页面的路径比较简单,推荐使用页头组件而非面包屑组件。
|
|
|
|
|
2021-04-25 21:17:39 +08:00
|
|
|
### 基础用法
|
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="详情页面"> </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
|
|
|
### 自定义图标
|
|
|
|
|
|
|
|
:::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="详情页面"></el-page-header>
|
|
|
|
```
|
2021-09-04 19:29:28 +08:00
|
|
|
|
2021-04-25 21:17:39 +08:00
|
|
|
:::
|
|
|
|
|
2020-08-13 15:18:26 +08:00
|
|
|
### Attributes
|
|
|
|
|
2021-09-04 19:29:28 +08:00
|
|
|
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
|
|
| ------- | ---- | ------ | ------ | ------------ |
|
|
|
|
| icon | 图标 | string | — | el-icon-back |
|
|
|
|
| title | 标题 | string | — | 返回 |
|
|
|
|
| content | 内容 | string | — | — |
|
2020-08-13 15:18:26 +08:00
|
|
|
|
|
|
|
### Events
|
2021-09-04 19:29:28 +08:00
|
|
|
|
|
|
|
| 事件名称 | 说明 | 回调参数 |
|
|
|
|
| -------- | ---------------- | -------- |
|
|
|
|
| back | 点击左侧区域触发 | — |
|
2020-08-13 15:18:26 +08:00
|
|
|
|
|
|
|
### Slots
|
2021-09-04 19:29:28 +08:00
|
|
|
|
|
|
|
| 事件名称 | 说明 |
|
|
|
|
| -------- | ---------- |
|
|
|
|
| icon | 自定义图标 |
|
|
|
|
| title | 标题内容 |
|
|
|
|
| content | 内容 |
|