Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slider console warning #5289

Closed
1 task
mofada opened this issue Feb 23, 2022 · 4 comments
Closed
1 task

slider console warning #5289

mofada opened this issue Feb 23, 2022 · 4 comments
Labels

Comments

@mofada
Copy link

mofada commented Feb 23, 2022

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.0.0-beta.10

Environment

windows 11 , chrome 版本 98.0.4758.102(正式版本) (64 位) ,Vue ^3.2.31

Reproduction link

https://next.antdv.com/components/slider-cn#components-slider-demo-event

Steps to reproduce

<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" />
</div>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue';

export default defineComponent({
setup() {
const value1 = ref<number>(30);
const value2 = ref<[number, number]>([20, 50]);

const onAfterChange = (value: number) => {
console.log('afterChange: ', value);
};

return {
value1,
value2,
onAfterChange,
};
},
});
</script>
<style scoped>
.code-box-demo .ant-slider {
margin-bottom: 16px;
}
</style>

What is expected?

What is actually happening?

Component emitted event "beforeChange" but it is neither declared in the emits option nor as an "onBeforeChange" prop.
Component emitted event "afterChange" but it is neither declared in the emits option nor as an "onAfterChange" prop.

warn2 @ runtime-core.esm-bundler.js:38
emit$1 @ runtime-core.esm-bundler.js:666
onEnd @ Slider.js:98

@github-actions github-actions bot changed the title slider 控制台警告 slider console warning Feb 23, 2022
@mofada
Copy link
Author

mofada commented Feb 23, 2022

image

@SignDawn
Copy link

你需要发一个能重现的线上例子,不然大家不是要搭环境嘛?
https://codesandbox.io/

@qcj007
Copy link

qcj007 commented Jun 14, 2022

3.0以上版本的slider丢失了beforeChange

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants