ant-design-vue/components/slider/demo/tip-formatter.vue

29 lines
537 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<docs>
---
order: 3
title:
zh-CN: 自定义提示
en-US: Customize tooltip
---
## zh-CN
使用 `tipFormatter` 可以格式化 `Tooltip` 的内容设置 `tipFormatter={null}`则隐藏 `Tooltip`
## en-US
Use `tipFormatter` to format content of `Tooltip`. If `tipFormatter` is null, hide it.
</docs>
<template>
<div>
<a-slider :tip-formatter="formatter" />
<a-slider :tip-formatter="null" />
</div>
</template>
<script lang="ts" setup>
const formatter = (value: number) => {
return `${value}%`;
};
</script>