cbest-directives

1.0.0 • Public • Published

使用方法

src/plugins/directives/index.js

import { segmaLoading, inputNumber } from '@segma/segma-directives';

const directives = [
    segmaLoading,
    inputNumber
];

export default {
    install(vue) {
        directives.forEach(d => {
            vue.directive(d.name, d.directive);
        });
    }
};

快速使用

1. segmaLoading

加载动画指令

使用

<div class="loading"
     v-segma-loading="true"
     segma-loading-background="gray"
     segma-loading-text="我是一个loading">
</div>

说明

v-segma-loading: 一般由一个Boolean型变量控制

segma-loading-background: 自定义loading背景颜色, 默认为rgba(255, 255, 255, 0.65)

segma-loading-text: 自定义loading文字, 默认为空

2. onlyNumber

数字输入框指令

使用

<el-input v-number="{ max: 10, min: 0, precision: 2}"
          v-model="number">
</el-input>

说明

max: 最大值配置

min: 最小值配置

precision: 最大小数位数配置

/cbest-directives/

    Package Sidebar

    Install

    npm i cbest-directives

    Weekly Downloads

    0

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    22.4 kB

    Total Files

    3

    Last publish

    Collaborators

    • qq461728402