naive-ui/demo/documentation/components/thing/enUS/basic.demo.md

94 lines
2.1 KiB
Markdown
Raw Normal View History

# Basic
2020-02-04 11:00:38 +08:00
Thing provides many slots to custom.
```html
2020-08-27 11:52:47 +08:00
<n-row>
<n-col :span="12">
<n-checkbox v-model="avatar">Avatar</n-checkbox>
</n-col>
<n-col :span="12">
<n-checkbox v-model="action">Action</n-checkbox>
</n-col>
</n-row>
<n-row>
<n-col :span="12">
<n-checkbox v-model="header">Header</n-checkbox>
</n-col>
<n-col :span="12">
<n-checkbox v-model="headerExtra">Header Extra</n-checkbox>
</n-col>
</n-row>
<n-row>
<n-col :span="12">
<n-checkbox v-model="description">Description</n-checkbox>
</n-col>
<n-col :span="12">
<n-checkbox v-model="footer">Footer</n-checkbox>
</n-col>
</n-row>
<n-divider />
<n-thing>
2019-11-26 18:16:50 +08:00
<template v-slot:avatar v-if="avatar">
<n-avatar>
<n-icon>
<md-cash />
</n-icon>
</n-avatar>
</template>
2019-11-26 18:16:50 +08:00
<template v-slot:header v-if="header">
Money
</template>
2019-11-26 18:16:50 +08:00
<template v-slot:header-extra v-if="headerExtra">
<n-button circle size="tiny">
<template v-slot:icon>
<md-cash />
</template>
</n-button>
</template>
2019-11-26 18:16:50 +08:00
<template v-slot:description v-if="description">
2020-02-04 11:00:38 +08:00
Description
</template>
Money is any item or verifiable record that is generally accepted as payment for goods and services and repayment of debts, such as taxes, in a particular country or socio-economic context.
2019-11-26 18:16:50 +08:00
<template v-slot:footer v-if="footer">
2020-02-04 11:00:38 +08:00
Footer
</template>
2019-11-26 18:16:50 +08:00
<template v-slot:action v-if="action">
<n-button size="tiny" style="margin-right: 8px;">
<template v-slot:icon>
<md-cash />
</template>
2020-02-04 11:00:38 +08:00
1$
</n-button>
<n-button size="tiny" style="margin-right: 8px;">
<template v-slot:icon>
<md-cash />
</template>
2020-02-04 11:00:38 +08:00
10$
</n-button>
<n-button size="tiny">
<template v-slot:icon>
<md-cash />
</template>
2020-02-04 11:00:38 +08:00
100$
</n-button>
</template>
</n-thing>
```
```js
import mdCash from 'naive-ui/lib/icons/md-cash'
export default {
components: {
mdCash
2019-11-26 18:16:50 +08:00
},
data () {
return {
avatar: true,
header: true,
headerExtra: true,
description: true,
footer: true,
action: true
}
}
}
```