-
Notifications
You must be signed in to change notification settings - Fork 0
input.vue $root.$on
Carl's edited this page Jun 4, 2021
·
5 revisions
- preset
let intValue="";
<ky-input v-model="intValue" type="int" />
this.$root.$emit(EventKeys["vue-keyboard-cn-append-item"],1);
- test
document.querySelector(".vue-keyboard-input-text").innerHTML==`<span class="vue-keyboard-text-item" tabindex="0">1</span>`
- return true
- preset
let intValue="";
<ky-input v-model="intValue" type="int" />
this.$root.$emit(EventKeys["vue-keyboard-cn-append-item"],1.1);
- test
document.querySelector(".vue-keyboard-input-text").innerHTML==``
- return false
- preset
let intValue="";
<ky-input
v-model="value1"
:regx="/^[\d%+-/]+$/gi"
type="int"
@submit="submitFn"
class="hahahha"
/>
this.$root.$emit(EventKeys["vue-keyboard-cn-append-item"],"%");
- test
document.querySelector(".vue-keyboard-input-text").innerHTML==`<span class="vue-keyboard-text-item" tabindex="0">%</span>`
- return true
- preset
let intValue="";
<ky-input v-model="intValue" type="int" />
this.$root.$emit(EventKeys["vue-keyboard-cn-append-item"],1);
- test
document.querySelector(".vue-keyboard-input-text").innerHTML==`1`
- return true (是运行输入整数的,因为1.12这样的小数也是分别由用户输入"1",".","1","2"的)
- preset
let intValue="";
<ky-input v-model="intValue" type="int" />
this.$root.$emit(EventKeys["vue-keyboard-cn-append-item"],1.12);
- test
document.querySelector(".vue-keyboard-input-text").innerHTML==`<span class="vue-keyboard-text-item" tabindex="0">1.12</span>`
- return true
- preset
let intValue="";
<ky-input v-model="intValue" type="int" />
this.$root.$emit(EventKeys["vue-keyboard-cn-append-item"],1.123);
- test
document.querySelector(".vue-keyboard-input-text").innerHTML==`<span class="vue-keyboard-text-item" tabindex="0">1.123</span>`
- return false 不允许输入超过限制长度的小数
- preset
let intValue="";
<ky-input v-model="intValue" type="cn" />
this.$root.$emit(EventKeys["vue-keyboard-cn-append-item"],"你");
- test
document.querySelector(".vue-keyboard-input-text").innerHTML==`<span class="vue-keyboard-text-item" tabindex="0">你</span>`
- return true
- preset
let intValue="";
<ky-input v-model="intValue" type="cn" />
this.$root.$emit(EventKeys["vue-keyboard-cn-append-item"],"你·你");
- test
document.querySelector(".vue-keyboard-input-text").innerHTML==`<span class="vue-keyboard-text-item" tabindex="0">你·你</span>`
- return true
- preset
let intValue="";
<ky-input v-model="intValue" type="cn" />
this.$root.$emit(EventKeys["vue-keyboard-cn-append-item"],",");
- test
document.querySelector(".vue-keyboard-input-text").innerHTML==``
- return true
- preset
let intValue="";
<ky-input v-model="intValue" type="en" />
this.$root.$emit(EventKeys["vue-keyboard-cn-append-item"],"z");
- test
document.querySelector(".vue-keyboard-input-text").innerHTML==`<span class="vue-keyboard-text-item" tabindex="0">z</span>`
- return true
- preset
let intValue="";
<ky-input v-model="intValue" type="en" />
this.$root.$emit(EventKeys["vue-keyboard-cn-append-item"],"Z");
- test
document.querySelector(".vue-keyboard-input-text").innerHTML==`<span class="vue-keyboard-text-item" tabindex="0">Z</span>`
- return true
- preset
let intValue="";
<ky-input v-model="intValue" type="en" />
this.$root.$emit(EventKeys["vue-keyboard-cn-append-item"],",");
- test
document.querySelector(".vue-keyboard-input-text").innerHTML==``
- return true
happy,ending!!