Skip to content

Commit

Permalink
docs: event demo (#7699) (#7728)
Browse files Browse the repository at this point in the history
  • Loading branch information
5918vo authored Sep 5, 2024
1 parent c69a6d2 commit 89eec07
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/slider/demo/event.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@ 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>
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);
};
Expand Down

0 comments on commit 89eec07

Please sign in to comment.