forked from vuejs-tips/vue-the-mask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
34 lines (31 loc) · 1.03 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">
</head>
<body>
<div id="app">
<!-- <the-mask id="input" mask="+1 ##.##.###)" @input.native="updateCursor" @keyup.native="updateCursor"></the-mask> -->
<input id="input" type="tel" v-mask="'+1 ##.##.###)'" @input="updateCursor" @keyup="updateCursor" />
<!-- <input id="input3" @input="updateCursor2" @keypress="updateCursor2" @keydown="updateCursor2" @keyup="updateCursor2"> -->
<input id="cursor" :value="cursor">
</div>
<script src="../node_modules/vue/dist/vue.js"></script>
<!-- <script src="../dist/vue-the-mask.js"></script> -->
<script src="../dist/VueTheMask.umd.js"></script>
<script>
new Vue({
el: '#app',
data: () => ({ cursor: 0 }),
methods: {
updateCursor($event) {
this.cursor = $event.target.selectionEnd
},
updateCursor2($event) {
this.cursor = $event.target.selectionEnd
}
}
})
</script>
</body>
</html>