Coder Social home page Coder Social logo

input-pc's Introduction

ca-input-pc

An input plugin for vue

Install

NPM

npm install ca-input-pc --save

Mount

mount with global
// main.js
import CaInputPc from 'ca-slider-pc'
Vue.use(CaInputPc)
mount with component
import { CaInputPc } from 'ca-slider-pc'

export default {
  components: {
    CaInputPc
  }
}

Options

input(text, password)

{
    inputType: String, //text, password
    regexp: RegExp, //自定义正则表达式,在blur时候验证
    textType: String, //默认可选正则验证,password, phone, account, email,integer,默认无
    blurVerify: Boolean, //是否开启blur验证,默认false
}

input(file)

{
    inputType: String, //file
    regexp: RegExp, //自定义正则表达式,在blur时候验证
    buttonTxt: String, //上传按钮文字
    maxSize: Number, //文件最大可上传大小
    fileType: Array,
    //验证文件类型正则选项,示例[1,2,3],0 pdf, 1 jpeg jpg jpe,2 gif, 3 png, 4 excel, 5 word, 6 mp4, 7 ogg, 8 mpeg
    fileVerify: Boolean //是否验证上传的文件, 默认false
}

Methods

  • input(input,password) @result
  • input(file) @getFile

Demo

    <template>
      <div class="hello">
        <div class="input-demo">
          <ca-input-pc :inputType="options.inputType" :blurVerify="options.blurVerify" :textType="options.textType" @result ="onBlur"></ca-input-pc>
        </div>
      </div>
    </template>

    <script>
        export default {
            name: 'demo',
            data() {
                return {
                    options:{
                        inputType: "text",
                        blurVerify: true,
                        textType: "account"
                    }
                }
            },
            methods: {
                onBlur(val) {
                    console.log(val);
                }
            }
        }
    </script>

input-pc's People

Contributors

tookfreshman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.