WebApp【公共组件库】@前端(For Git Submodule)
Tevin
2023-11-22 9a0ea77000478287ba82e4af0e7258fd1e43044c
扫码输入框,支持只读
2 files modified
15 ■■■■■ changed files
forms/input/CInputScanCode.scss 4 ●●●● patch | view | raw | blame | history
forms/input/CInputScanCode.vue 11 ●●●●● patch | view | raw | blame | history
forms/input/CInputScanCode.scss
@@ -6,6 +6,10 @@
@import "../../common/sassMixin";
.c-input-scan-code {
    &.read-only {
        pointer-events: none;
        background-color: #fafafa;
    }
    .c-input-scan-space {
        width: 140px;
        height: 48px;
forms/input/CInputScanCode.vue
@@ -4,7 +4,10 @@
 */
<template>
    <view class="c-input-scan-code">
    <view
        class="c-input-scan-code"
        :class="[readOnly ? 'read-only':'']"
    >
        <AtInput
            :name="itemRes.name"
            :title="itemRes.label"
@@ -21,6 +24,7 @@
                class="c-input-scan-btn"
                size="small"
                type="primary"
                :disabled="readOnly"
                :onClick="evt => handleScan()"
            >
                <text v-show="!scaning">扫描</text>
@@ -51,6 +55,11 @@
        itemRes: Object,
        // 占位提示
        placeholder: String,
        // 只读模式
        readOnly: {
            type: Boolean,
            default: false,
        },
        // 由业务层调用app
        onScaning: Function,
        // 失去焦点回调