Commit a2f94e61 authored by Roma's avatar Roma

Demo fix, refactor

parent 6621311e
.vscode
.DS_Store
node_modules/
npm-debug.log
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
{
"name": "vue-masked-input",
"description": "Masked input component for Vue.js 2.X",
"version": "0.3.2",
"version": "0.3.3",
"author": "niksmr",
"license": "MIT",
"homepage": "https://github.com/niksmr/vue-masked-input",
......
......@@ -16,7 +16,6 @@
<li>+ – any character</li>
</ul>
<temp v-model="date" mask="11 / 11 / 1111" placeholder="Date" name="date"/>
<h4>Date: </h4>
<masked-input v-model="date" mask="11 / 11 / 1111" placeholder="Date"/><span>{{ date }}</span>
<p class="code">
......
......@@ -91,8 +91,8 @@ export default {
},
}
})
for (let i = 0; i < this.$refs.input.value.length; ++i) {
this.mask_core.input(this.$refs.input.value[i])
for (const char of this.$refs.input.value) {
this.mask_core.input(char)
}
this.mask_core.setSelection({
start: 0,
......@@ -222,8 +222,8 @@ export default {
/*
IE & FF are not trigger textInput event, so we have to force it
*/
let isIE = /*@cc_on!@*/false || !!document.documentMode; //by http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
let isFirefox = typeof InstallTrigger !== 'undefined';
const isIE = /*@cc_on!@*/false || !!document.documentMode; //by http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
const isFirefox = typeof InstallTrigger !== 'undefined';
if (isIE || isFirefox) {
......@@ -267,9 +267,9 @@ export default {
paste(e) {
e.preventDefault()
let text = e.clipboardData.getData('text')
for (let i = 0; i < text.length; ++i) {
this.mask_core.input(text[i])
const pasteText = e.clipboardData.getData('text')
for (const char of pasteText) {
this.mask_core.input(char)
}
this.updateToCoreState()
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment