docs(thing): Upgrade the use case of thing component to Composition API (#1044)

This commit is contained in:
songjianet 2021-09-02 22:12:10 +08:00 committed by GitHub
parent 5ca2fd39ba
commit 87d834a42c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 36 deletions

View File

@ -81,21 +81,22 @@ Thing provides many slots to custom.
``` ```
```js ```js
import { defineComponent, ref } from 'vue'
import { CashOutline as CashIcon } from '@vicons/ionicons5' import { CashOutline as CashIcon } from '@vicons/ionicons5'
export default { export default defineComponent({
components: { components: {
CashIcon CashIcon
}, },
data () { setup () {
return { return {
avatar: true, avatar: ref(true),
header: true, header: ref(true),
headerExtra: true, headerExtra: ref(true),
description: true, description: ref(true),
footer: true, footer: ref(true),
action: true action: ref(true)
} }
} }
} })
``` ```

View File

@ -81,21 +81,22 @@ Content can be indented after avatar.
``` ```
```js ```js
import { defineComponent, ref } from 'vue'
import { CashOutline as CashIcon } from '@vicons/ionicons5' import { CashOutline as CashIcon } from '@vicons/ionicons5'
export default { export default defineComponent({
components: { components: {
CashIcon CashIcon
}, },
data () { setup () {
return { return {
avatar: true, avatar: ref(true),
header: true, header: ref(true),
headerExtra: true, headerExtra: ref(true),
description: true, description: ref(true),
footer: true, footer: ref(true),
action: true action: ref(true)
} }
} }
} })
``` ```

View File

@ -79,21 +79,22 @@ Thing 提供了很多 slot 来定制。
``` ```
```js ```js
import { defineComponent, ref } from 'vue'
import { CashOutline as CashIcon } from '@vicons/ionicons5' import { CashOutline as CashIcon } from '@vicons/ionicons5'
export default { export default defineComponent({
components: { components: {
CashIcon CashIcon
}, },
data () { setup () {
return { return {
avatar: true, avatar: ref(true),
header: true, header: ref(true),
headerExtra: true, headerExtra: ref(true),
description: true, description: ref(true),
footer: true, footer: ref(true),
action: true action: ref(true)
} }
} }
} })
``` ```

View File

@ -79,21 +79,22 @@
``` ```
```js ```js
import { defineComponent, ref } from 'vue'
import { CashOutline as CashIcon } from '@vicons/ionicons5' import { CashOutline as CashIcon } from '@vicons/ionicons5'
export default { export default defineComponent({
components: { components: {
CashIcon CashIcon
}, },
data () { setup () {
return { return {
avatar: true, avatar: ref(true),
header: true, header: ref(true),
headerExtra: true, headerExtra: ref(true),
description: true, description: ref(true),
footer: true, footer: ref(true),
action: true action: ref(true)
} }
} }
} })
``` ```