我的问题与Angular非常相似: Angular-imask我如何获得iMask类?
我对VUE组成api https://github.com/unmanner/imaskjs/tree/master/packages/vue-imask-mask-mask-mask-mask-composable-vue-3 可以拨打 mask.updatevalue()代码>为了使其与Veevalidate一起使用(ex:)。
这是我从控制台收到的消息:
元素值在蒙版之外更改。使用 mask.updatevalue()
同步掩码才能正常工作。
我尝试像 const {mask} = useimask(formatterMask)
那样检索iMask类,但它不是不幸的imask类。
有什么想法如何进行?
谢谢。
My question is very similar to this one for angular: In angular-imask how do I get the IMask class?
I'm especially interested about the Vue Composition API https://github.com/uNmAnNeR/imaskjs/tree/master/packages/vue-imask#mask-composable-vue-3 to be able to call mask.updateValue()
in order to make it work with VeeValidate (ex: https://vee-validate.logaretm.com/v4/examples/value-formatting).
Here is the message I get from the console:
Element value was changed outside of mask. Syncronize mask using mask.updateValue()
to work properly.
I've tried to retrieve the IMask class like that const { mask } = useIMask(formatterMask)
but it is not the IMask class unfortunatly.
Any idea how to proceed?
Thank you.
发布评论
评论(1)
imask
实例确实是存储在mask
中从useimask()
返回。因为掩码
是 /a>,您需要通过其.value
属性来解开它:The
IMask
instance is indeed stored inmask
returned fromuseIMask()
. Sincemask
is aref
, you need to unwrap it via its.value
property: