kevinongko / vue-numeric

Input field component to display a formatted currency value based on Vue.js
https://kevinongko.github.io/vue-numeric/
MIT License
461 stars 118 forks source link

IE11 strict模式下不允许一个属性有多个定义 #25

Closed yanghao1351 closed 7 years ago

yanghao1351 commented 7 years ago

IE11 strict模式下不允许一个属性有多个定义

kevinongko commented 7 years ago

Hi @yanghao1351 ,

I don't understand Mandarin 😢

flkrnr commented 7 years ago

I think he ment that the plugin is not working with IE11. I had the same issue. I'll send you the accurate error message later

ra-dharma commented 7 years ago

Hi kevinongko,

Thanks for an excellent plugin.

I've implemented this in a variety of forms in my application. It works perfect in Chrome/Firefox browsers. But getting the following error in IE11. Can you please help with ?

SCRIPT1046: Multiple definitions of a property not allowed in strict mode File: vue-numeric, Line: 1, Column: 4665

in this line - domProps:{value:e.value,value:e.amount}

Thanks, D

te1 commented 7 years ago

The problem seems to be the :value="value" binding. If remove this the generated render function contains domProps: { value: _vm.amount } as expected and it works in IE. I have not found any negative side effects.

From https://vuejs.org/v2/guide/forms.html#Basic-Usage:

v-model will ignore the initial value, checked or selected attributes found on any form elements.

It seems that the binding is not needed and instead you should do this.amount = this.value which happens in mounted anyway as far as I can tell.

Hope this helps.

kevinongko commented 7 years ago

Thanks for the suggestion and error messages guys, sorry for the late fix. The plugin (v2.2.2) should work now in IE11