docs(badge): use composition api (#972)

This commit is contained in:
songjianet 2021-08-26 23:36:03 +08:00 committed by GitHub
parent 472f373ea5
commit 4126328bf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 53 additions and 62 deletions

View File

@ -24,17 +24,18 @@
```
```js
import { defineComponent, ref } from 'vue'
import { MdAdd, MdRemove } from '@vicons/ionicons4'
export default {
export default defineComponent({
components: {
MdAdd,
MdRemove
},
data () {
setup () {
return {
value: 5
value: ref(5)
}
}
}
})
```

View File

@ -12,6 +12,7 @@ show-zero
overflow
manual
custom-content
color
raw
```

View File

@ -25,18 +25,19 @@
```
```js
import { defineComponent, ref } from 'vue'
import { MdAdd, MdRemove } from '@vicons/ionicons4'
export default {
export default defineComponent({
components: {
MdAdd,
MdRemove
},
data () {
setup () {
return {
value: 5,
show: true
value: ref(5),
show: ref(true)
}
}
}
})
```

View File

@ -32,17 +32,18 @@ Set `max` prop to handle overflow situation.
```
```js
import { defineComponent, ref } from 'vue'
import { MdAdd, MdRemove } from '@vicons/ionicons4'
export default {
export default defineComponent({
components: {
MdAdd,
MdRemove
},
data () {
setup () {
return {
value: 101
value: ref(101)
}
}
}
})
```

View File

@ -20,17 +20,18 @@
```
```js
import { defineComponent, ref } from 'vue'
import { MdAdd, MdRemove } from '@vicons/ionicons4'
export default {
export default defineComponent({
components: {
MdAdd,
MdRemove
},
data () {
setup () {
return {
value: 5
value: ref(5)
}
}
}
})
```

View File

@ -26,17 +26,18 @@ Set `show-zero` prop to display zero.
```
```js
import { defineComponent, ref } from 'vue'
import { MdAdd, MdRemove } from '@vicons/ionicons4'
export default {
export default defineComponent({
components: {
MdAdd,
MdRemove
},
data () {
setup () {
return {
value: 0
value: ref(0)
}
}
}
})
```

View File

@ -21,13 +21,3 @@ Badge has `default`, `error`, `info`, `success`, `warning` types.
</n-badge>
</n-space>
```
```js
export default {
data () {
return {
value: 10
}
}
}
```

View File

@ -24,17 +24,18 @@
```
```js
import { defineComponent, ref } from 'vue'
import { MdAdd, MdRemove } from '@vicons/ionicons4'
export default {
export default defineComponent({
components: {
MdAdd,
MdRemove
},
data () {
setup () {
return {
value: 5
value: ref(5)
}
}
}
})
```

View File

@ -25,18 +25,19 @@
```
```js
import { defineComponent, ref } from 'vue'
import { MdAdd, MdRemove } from '@vicons/ionicons4'
export default {
export default defineComponent({
components: {
MdAdd,
MdRemove
},
data () {
setup () {
return {
value: 5,
show: true
value: ref(5),
show: ref(true)
}
}
}
})
```

View File

@ -32,17 +32,18 @@
```
```js
import { defineComponent, ref } from 'vue'
import { MdAdd, MdRemove } from '@vicons/ionicons4'
export default {
export default defineComponent({
components: {
MdAdd,
MdRemove
},
data () {
setup () {
return {
value: 101
value: ref(101)
}
}
}
})
```

View File

@ -20,17 +20,18 @@
```
```js
import { defineComponent, ref } from 'vue'
import { MdAdd, MdRemove } from '@vicons/ionicons4'
export default {
export default defineComponent({
components: {
MdAdd,
MdRemove
},
data () {
setup () {
return {
value: 5
value: ref(5)
}
}
}
})
```

View File

@ -26,17 +26,18 @@
```
```js
import { defineComponent, ref } from 'vue'
import { MdAdd, MdRemove } from '@vicons/ionicons4'
export default {
export default defineComponent({
components: {
MdAdd,
MdRemove
},
data () {
setup () {
return {
value: 0
value: ref(0)
}
}
}
})
```

View File

@ -21,13 +21,3 @@
</n-badge>
</n-space>
```
```js
export default {
data () {
return {
value: 10
}
}
}
```