Skip to content

Commit a2f94e6

Browse files
committed
Demo fix, refactor
1 parent 6621311 commit a2f94e6

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.vscode
12
.DS_Store
23
node_modules/
34
npm-debug.log

dist/build.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/build.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-masked-input",
33
"description": "Masked input component for Vue.js 2.X",
4-
"version": "0.3.2",
4+
"version": "0.3.3",
55
"author": "niksmr",
66
"license": "MIT",
77
"homepage": "https://github.com/niksmr/vue-masked-input",

src/App.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
<li>+ – any character</li>
1717
</ul>
1818

19-
<temp v-model="date" mask="11 / 11 / 1111" placeholder="Date" name="date"/>
2019
<h4>Date: </h4>
2120
<masked-input v-model="date" mask="11 / 11 / 1111" placeholder="Date"/><span>{{ date }}</span>
2221
<p class="code">

src/MaskedInput.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ export default {
9191
},
9292
}
9393
})
94-
for (let i = 0; i < this.$refs.input.value.length; ++i) {
95-
this.mask_core.input(this.$refs.input.value[i])
94+
for (const char of this.$refs.input.value) {
95+
this.mask_core.input(char)
9696
}
9797
this.mask_core.setSelection({
9898
start: 0,
@@ -222,8 +222,8 @@ export default {
222222
/*
223223
IE & FF are not trigger textInput event, so we have to force it
224224
*/
225-
let isIE = /*@cc_on!@*/false || !!document.documentMode; //by http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
226-
let isFirefox = typeof InstallTrigger !== 'undefined';
225+
const isIE = /*@cc_on!@*/false || !!document.documentMode; //by http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
226+
const isFirefox = typeof InstallTrigger !== 'undefined';
227227
228228
229229
if (isIE || isFirefox) {
@@ -267,9 +267,9 @@ export default {
267267
268268
paste(e) {
269269
e.preventDefault()
270-
let text = e.clipboardData.getData('text')
271-
for (let i = 0; i < text.length; ++i) {
272-
this.mask_core.input(text[i])
270+
const pasteText = e.clipboardData.getData('text')
271+
for (const char of pasteText) {
272+
this.mask_core.input(char)
273273
}
274274
this.updateToCoreState()
275275
},

0 commit comments

Comments
 (0)