Browse Source

docs: event demo (#7699) (#7728)

pull/7825/head
5918vo 3 months ago committed by GitHub
parent
commit
89eec07145
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      components/slider/demo/event.vue

8
components/slider/demo/event.vue

@ -17,8 +17,8 @@ The `onChange` callback function will fire when the user changes the slider's va
<template>
<div class="code-box-demo">
<a-slider v-model:value="value1" @afterChange="onAfterChange" />
<a-slider v-model:value="value2" range :step="10" @afterChange="onAfterChange" />
<a-slider v-model:value="value1" @change="onChange" @afterChange="onAfterChange" />
<a-slider v-model:value="value2" range :step="10" @change="onChange" @afterChange="onAfterChange" />
</div>
</template>
<script lang="ts" setup>
@ -26,6 +26,10 @@ import { ref } from 'vue';
const value1 = ref<number>(30);
const value2 = ref<[number, number]>([20, 50]);
const onChange = (value: number) => {
console.log('onChange: ', value);
};
const onAfterChange = (value: number) => {
console.log('afterChange: ', value);
};

Loading…
Cancel
Save