-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Cleave is broken with Vue #459
Comments
There is really nothing wrong with Cleave or Vuetify. Here is my <script>
import Cleave from 'cleave.js';
export default {
props: {
value: {
type: [String, Number],
required: false,
default: '',
},
},
data() {
return {
currentValue: this.value,
};
},
mounted() {
this.cleave = new Cleave(this.$el.querySelector('input'), {
numeral: true,
onValueChanged: this.onValueChanged.bind(this),
});
this.cleave.setRawValue(this.value);
},
methods: {
onValueChanged({ target }) {
this.$nextTick(() => {
this.currentValue = target.value;
this.$emit('input', target.rawValue);
});
},
},
};
</script>
<template>
<v-text-field
v-model="currentValue"
v-bind="$attrs"
:label="$t(domain)"
height="22"
class="caption rbx-text-input"
/>
</template> I would like to mention two specific lines here.
|
For those that are still having issues binding Cleave to
The |
@fatihacet thanks this works for me.. for other people reference :)
|
Or as directive (Vuetify), it is hackish but works for now.
|
@harlet That works good but keep in mind that you cannot fill form data with a click anymore. The data shows up for a second and disappears. But for now its a decent workaround to the issue. Just wondering if this is gonna get properly fixed any time?! |
This worked. Thanks! |
Vue 2.6 did introduce a probably breaking change by using MicroTasks instead of MacroTasks, see for the problem and a solution. |
Cleave is not working with vue/vuetify
vuetifyjs/vuetify#6910 (comment)
The text was updated successfully, but these errors were encountered: