mirror of
https://git.hmsn.ink/kospo/svcm/oa.git
synced 2026-03-20 17:13:31 +09:00
first
This commit is contained in:
53
documentation/plugins/slider/slider-format-documentation.md
Normal file
53
documentation/plugins/slider/slider-format-documentation.md
Normal file
@@ -0,0 +1,53 @@
|
||||
---
|
||||
state:
|
||||
value: 54
|
||||
---
|
||||
|
||||
### Tooltip format
|
||||
|
||||
The `<Slider />` component allows to pass a formatting function to its `format`
|
||||
property. You can return the tooltip value with the format that you want.
|
||||
|
||||
<!--code-->
|
||||
|
||||
```vue
|
||||
<script setup lang="ts">
|
||||
|
||||
const value = ref(54)
|
||||
const format = (value) => {
|
||||
return `${value}%`
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VField v-slot="{ id }" class="has-curved-tooltip">
|
||||
<VControl>
|
||||
<Slider
|
||||
:id="id"
|
||||
v-model="value"
|
||||
:format="format"
|
||||
/>
|
||||
</VControl>
|
||||
</VField>
|
||||
</template>
|
||||
```
|
||||
|
||||
<!--/code-->
|
||||
|
||||
<!--example-->
|
||||
|
||||
<div class="columns mt-2">
|
||||
<div class="column is-6">
|
||||
<VField v-slot="{ id }" class="pt-5 px-4 has-curved-tooltip">
|
||||
<VControl>
|
||||
<Slider
|
||||
:id="id"
|
||||
v-model="frontmatter.state.value"
|
||||
:format="(value) => value + '%'"
|
||||
/>
|
||||
</VControl>
|
||||
</VField>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--/example-->
|
||||
Reference in New Issue
Block a user