1.0.1 • Published 6 years ago

vue-input-effects v1.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

vue-input-effects

image


Install

    npm install --save vue-input-effects
    
    yarn add vue-input-effects

Basic use

    全局
    
    import iput from 'vue-input-effects'
    Vue.use(iput)
    
    局部
    import {Input, Shy, Dird, Duck, Fish, Goose, Panda, Pig} from 'vue-input-effects'
    export default {
        components: {Input, Shy, Dird, Duck, Fish, Goose, Panda, Pig}
    }
    

example


全局属性方法

属性类型默认值说明
heightstring/number35
widthstring/number260
input-stylestring输入框样式 宽高不管用
disabledbooleanfalse是否可点击使用
autofocusbooleanfalse是否自动聚焦
full-widthbooleanfalse是否沾满父盒子
help-textstring提示文字
focusfunction输入框聚焦事件
blurfunction输入框失焦事件
changefunction输入框改变事件

全局插槽

<slot name="header"></slot>
<slot name="footer"></slot>

使用

<div slot="header"></div>
<div slot="footer"></div>

组件

效果


所有组件默认插槽无样式需要自定义样式后可见效果


Input
<Input v-model="input0" />

Shy
属性类型默认值说明取值
locationStringleft下划线滚动开始位置left/right/center
underlineColorString下划线颜色
defaultUnderlineColorString默认下划线颜色
underlineShowBooleantrue下划线是否出现
iconShowBooleantrue插槽是否出现
<template>
  <Shy v-model="input1">
    <div slot="icon-slot" class="input1"></div>
  </Shy>
</template>

<style>
  .input1 {
    height: 100%;
    width: 100%;
    background: #CE02E8
  }
</style>

Dird
属性类型默认值说明取值
underlineColorString下划线颜色
<Dird v-model="input2" />

Duck
<template>
  <Duck v-model="input3">
    <div slot="icon-slot" class="input3"></div>
  </Duck>
</template>

<style>
  .input3 {
    height: 100%;
    width: 100%;
    background: #8D6BFF
  }
</style>

Fish
属性类型默认值说明取值
underlineColorString下划线颜色
defaultUnderlineColorString默认下划线颜色
underlineShowBooleantrue下划线是否出现
<template>
  <Fish v-model="input4">
    <div slot="icon-slot" class="input4">阳光网站</div>
  </Fish>
</template>

<style>
  .input4 {
    height: 100%;
    width: 100%;
    background: #8D6BFF;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 14px;
    padding: 0 10px;
  }
</style>

Goose
<template>
  <Goose v-model="input5">
    <div slot="icon-slot-one" class="input5-one"></div>
    <div slot="icon-slot-two" class="input5-two"></div>
  </Goose>
</template>

<style>
  .input5-one {
    height: 100%;
    width: 100%;
    background: black;
  }
  .input5-two {
    height: 100%;
    width: 100%;
    background: #8D6BFF;
  }
</style>

Panda
<template>
  <Panda v-model="input6">
    <div slot="icon-slot-two" class="input6">阳光网站</div>
  </Panda>
</template>

<style>
  .input6 {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    font-size: 14px;
    color: white;
    padding-left: 10px;
    background: #8D6BFF;
  }
</style>

Pig
属性类型默认值说明取值
underlineColorString下划线颜色
underlineShowBooleantrue下划线是否出现
<template>
  <Pig v-model="input7"/>
</template>

欢迎 pr issues star