mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-02-23 13:31:06 +08:00
docs(card): vue3
This commit is contained in:
parent
0fa0872d91
commit
2626147ae4
@ -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
|
||||
|名称|参数|说明|
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
import { h, Transition } from 'vue'
|
||||
|
||||
export default {
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user