1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-13 23:20:12 +08:00

Activate the calculator enter action using a native JavaScript method (#441)

This commit is contained in:
elsiosanchez 2020-04-14 00:11:14 -04:00 committed by GitHub
parent 1ac405ef53
commit 79cc4d0cbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -3,7 +3,6 @@
<el-input-number <el-input-number
:ref="metadata.columnName" :ref="metadata.columnName"
v-model="value" v-model="value"
v-shortkey="['enter']"
type="number" type="number"
:min="minValue" :min="minValue"
:max="maxValue" :max="maxValue"
@ -13,9 +12,9 @@
controls-position="right" controls-position="right"
:class="'display-type-amount'" :class="'display-type-amount'"
@change="preHandleChange" @change="preHandleChange"
@shortkey.native="changeValue"
@blur="changeValue" @blur="changeValue"
@keydown.native="calculateValue" @keydown.native="calculateValue"
@keyup.enter.native="changeValue"
/> />
</el-tooltip> </el-tooltip>
</template> </template>

View File

@ -7,10 +7,9 @@
<el-input <el-input
ref="calculatorInput" ref="calculatorInput"
v-model="calcValue" v-model="calcValue"
v-shortkey="['enter']"
class="calc-input" class="calc-input"
@keydown.native="calculateValue" @keydown.native="calculateValue"
@shortkey.native="changeValue" @keyup.enter.native="changeValue"
> >
<template slot="append">{{ valueToDisplay }}</template> <template slot="append">{{ valueToDisplay }}</template>
</el-input> </el-input>