[improvement] Panel: add icon prop (#1942)

This commit is contained in:
neverland 2018-10-17 11:53:02 +08:00 committed by GitHub
parent 9c5fa8a9d4
commit fcd5a53cf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -33,6 +33,7 @@ Vue.use(Panel);
| Attribute | Description | Type | Default | | Attribute | Description | Type | Default |
|-----------|-----------|-----------|-------------| |-----------|-----------|-----------|-------------|
| icon | Left Icon | `String` | - |
| title | Title | `String` | - | | title | Title | `String` | - |
| desc | Description | `String` | - | | desc | Description | `String` | - |
| status | Status | `String` | - | | status | Status | `String` | - |

View File

@ -1,7 +1,13 @@
<template> <template>
<cell-group :class="b()"> <cell-group :class="b()">
<slot name="header"> <slot name="header">
<cell :class="b('header')" :title="title" :label="desc" :value="status" /> <cell
:class="b('header')"
:icon="icon"
:label="desc"
:title="title"
:value="status"
/>
</slot> </slot>
<div :class="b('content')"> <div :class="b('content')">
<slot /> <slot />
@ -18,6 +24,7 @@ import create from '../utils/create';
export default create({ export default create({
name: 'panel', name: 'panel',
props: { props: {
icon: String,
desc: String, desc: String,
title: String, title: String,
status: String status: String

View File

@ -38,6 +38,7 @@ Vue.use(Panel);
| title | 标题 | `String` | - | | title | 标题 | `String` | - |
| desc | 描述 | `String` | - | | desc | 描述 | `String` | - |
| status | 状态 | `String` | - | | status | 状态 | `String` | - |
| icon | 标题左侧图标,可选值见 Icon 组件 | `String` | - |
### Slot ### Slot