ant-design-vue/components/slider/demo/basic.vue

48 lines
994 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: 0
title:
zh-CN: 基本
en-US: Basic
---
## zh-CN
基本滑动条 `range` `true` 渲染为双滑块 `disabled` `true` 滑块处于不可用状态
## en-US
Basic slider. When `range` is `true`, display as dual thumb mode. When `disable` is `true`, the slider will not be interactable.
</docs>
<template>
<div>
<a-slider id="test" v-model:value="value1" :disabled="disabled" />
<a-slider v-model:value="value2" range :disabled="disabled" />
Disabled:
<a-switch v-model:checked="disabled" size="small" />
</div>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
const value1 = ref<number>(0);
const value2 = ref<number[]>([20, 50]);
const disabled = ref<boolean>(false);
return {
value1,
value2,
disabled,
};
},
});
</script>
<style scoped>
.code-box-demo .ant-slider {
margin-bottom: 16px;
}
</style>