docs(card): vue3

This commit is contained in:
07akioni 2020-09-26 23:43:12 +08:00
parent 0fa0872d91
commit 2626147ae4
4 changed files with 13 additions and 15 deletions

View File

@ -1,5 +1,6 @@
# 卡片 Card
一些经验不足的 UI 设计师喜欢在它上面滥用阴影。
## 演示
```demo
basic
@ -10,23 +11,20 @@ border
segment
closable
```
## Props
|名称|类型|默认值|说明|
|-|-|-|-|
|title|`string`|`null`||
|bordered|`boolean`|`true`||
|closable|`boolean`|`false`||
|content-style|`Object \| string`|`null`||
|header-style|`Object \| string`|`null`||
|segmented|`boolean \| { [part in 'content' \| 'footer' \| 'action']?: boolean \| 'soft' \| 'hard' }`|`false`||
|size|`'small' \| 'medium' \| 'large' \| 'huge'`|`'medium'`||
|bordered|`boolean`|`true`||
|closable|`boolean`|`false`||
|theme|`'light' \| 'dark' \| null \| string`|`null`||
|themed-style|`{ [themeName: string]: Object } \| null`|`null`||
## Events
|名称|参数|说明|
|-|-|-|
|close|`()`||
|theme|`'light' \| 'dark' \| null \| string`|`null`||
|title|`string`|`null`||
|on-close|`() => any`|`undefined`|点击卡片关闭图标时的回调|
## Slots
|名称|参数|说明|

View File

@ -1,4 +1,3 @@
import { h, Transition } from 'vue'
export default {

View File

@ -14,7 +14,7 @@
<div v-if="$slots.cover" class="n-card-cover">
<slot name="cover" />
</div>
<div v-if="$slots.header || $slots.header || title || closable" class="n-card-header">
<div v-if="$slots.header || title || closable" class="n-card-header">
<div class="n-card-header__main" :style="headerStyle">
<slot name="header">
{{ title }}
@ -47,9 +47,9 @@
<script>
import withapp from '../../_mixins/withapp'
import themeable from '../../_mixins/themeable'
import usecssr from '../../_mixins/usecssr'
import NIcon from '../../icon'
import CloseIcon from '../../_icons/md-close'
import usecssr from '../../_mixins/usecssr'
import styles from './styles'
export default {
@ -94,12 +94,13 @@ export default {
},
onClose: {
type: Function,
default: () => {}
default: undefined
}
},
methods: {
handleCloseClick () {
this.onClose()
const { onClose } = this
if (onClose) onClose()
}
}
}

View File

@ -23,7 +23,7 @@ placeable 进行了大调整
- `on-show` => `on-update:show`
- `on-hide` => `on-update:show`
- `target` => `listen-to`
- [ ] badge
- [x] badge
- [x] breadcrumb
- [x] button
- [x] button-group