Ant Design Vue Slider change 拖动事件,即一直拖动一直会触发这个事件,和afterChange事件不同的是,afterChange事件需要松开鼠标才会触发。
<template>
<div>
<a-slider @change="change"/>
<div> {{currVal}}</div>
</div>
</template>
<script>
export default {
data() {
return {
currVal: '',
};
},
methods: {
//change事件
change(value){
this.currVal=value
}
},
};
</script>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Ant Design Vue slider change事件例子</title>
<script src="https://www.itxst.com/package/vue/vue.min.js"></script>
<script src="https://www.itxst.com/package/ant-design-vue/antd.min.js"></script>
<!--浏览器方式下有些事件无法响应,需要引入vue-dash-event插件-->
<script src="https://www.itxst.com/package/ant-design-vue/vue-dash-event.js"></script>
<link href="https://www.itxst.com/package/ant-design-vue/antd.min.css?aaa" rel="stylesheet" />
<style>
body {
padding: 10px
}
</style>
</head>
<body>
<div id="app">
<a-slider @change="change"></a-slider>
<div> {{currVal}}</div>
</div>
<script>
Vue.use(window['vue-dash-event']);
var app = new Vue({
el: '#app',
data() {
return {
currVal: '',
};
},
methods: {
change(value){
this.currVal=value;
}
},
});
</script>
</body>
</html>
例子