1.0.0 ā€¢ Published 6 years ago

jeep-ui v1.0.0

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

jeep-ui

šŸ‡ØšŸ‡³ äø­ę–‡ę–‡ę”£

npm npm

Practical UI for Vue.js

Inspired by Semantic-ui and Element-ui

image

why do it?

Usually, the Element UI will be my first choice to build a Vue.js project.

Unfortunately, the Element's form is not easy to use, and the form is too frequently to use.

So, there is jeep-ui. Hope robust as jeep.

For convenience, use the same form validator as Element, called async-validator.

Install

npm install jeep-ui

Quick start

Import all components

import Vue from 'vue'
import JeepUI from 'jeep-ui'

Vue.use(JeepUI)

Manually import

import { Button } from 'jeep-ui'

Vue.component(Button.name, Button)

Plan

Stage1: (2017.11.22 Done)

  • Button
  • Input
  • Radio
  • Checkbox
  • Toggle
  • Form

Stage2: (2017.12.6 Done)

  • DropDown
  • DatePicker
  • Loading

Stage3:

  • Upload
  • Modal

(...continue)

Usage

Part of templateļ¼š

<j-form :formData="data" :errorData="error" ref="form" :rules="rules">

  <j-form-item label="username" prop="username">
    <j-input></j-input>
  </j-form-item>
  
  <j-form-item label="password" prop="password">
    <j-input type="password"></j-input>
  </j-form-item>
  
  <j-form-item>
    <j-button @click="submit">submit</j-button>
  </j-form-item>
  
</j-form>

Part of JavaScriptļ¼š

export default {
  data() {
    return {
      data: {},
      rules: {},
      error: {}
    }
  },
  methods: {
    submit() {
      this.$refs.form.validate((data) => {
        console.log(data)
      })
    }
  }
}

Browser Support

Modern browsers and Internet Explorer 9+(no test).

Components

Form

AttributeDescriptionTypeAccepted valuesDefault
label-positionposition of labelstringleft,rightright
error-templatetemplate of error messagestring-prop is required
formDatathe entire data of formobject--
rulesvalidation rules of form (async-validator)object--
errorDatamessage of errorobject--

FormItem

AttributeDescriptionTypeAccepted valuesDefault
propa key of this itemstring--
labellabelstring--
requiredwhether the field is required or notbooleantrue,falsetrue
show-messagewhether the error message is show or notbooleantrue,falsetrue
labelWidthwidth of labelstring-80px
contentWidthwidth of contentstring-160px

Button

AttributeDescriptionTypeAccepted valuesDefault
typebutton typestring-text
plaindetermine whether it's a plain buttonbooleantrue,falsefalse
disabledisable the buttonbooleantrue,falsefalse
loadingdetermine whether it's loadingbooleantrue,falsefalse
nativeTypesame as native button's typestring-button

Input

AttributeDescriptionTypeAccepted valuesDefault
typeinput typestring-text
valueinput valuestringļ¼number--
disableddisable the inputbooleantrue,falsefalse
loadingdetermine whether it's loadingbooleantrue,falsefalse
prefixIconthe prefix iconstring--
suffixIconthe suffix iconstring--
readonlysame as native input's readonlybooleantrue,falsefalse
placeholdersame as native input's placeholderstring--
namesame as native input's namestring--
maxsame as native input's maxstring--
minsame as native input's minstring--
stepsame as native input's stepstring--
autofocussame as native input's autofocusstring--
formsame as native input's formstring--
autoCompletesame as native input's autoCompletestring--
focustriggers when Input focusfunction--
blurtriggers when Input blursfunction--
changetriggers when Input value changefunction--

Radio

AttributeDescriptionTypeAccepted valuesDefault
namesame as native radio's namestring--
readonlysame as native radio's readonlybooleantrue,falsefalse
checkedsame as native radio's checkedbooleantrue,falsefalse

RadioGroup

AttributeDescriptionTypeAccepted valuesDefault
optionsoptionsarray--
valueradio valuestringļ¼number--

Checkbox

AttributeDescriptionTypeAccepted valuesDefault
namesame as native checkbox's namestring--
readonlysame as native checkbox's readonlybooleantrue,falsefalse
checkedsame as native checkbox's checkedbooleantrue,falsefalse

CheckboxGroup

AttributeDescriptionTypeAccepted valuesDefault
optionsoptionsarray--
valuecheckbox valuestringļ¼number--

Toggle

AttributeDescriptionTypeAccepted valuesDefault
nameinput name of Togglestring--
checkedsame as native toggle's checkedbooleantrue,falsefalse

Dropdown

AttributeDescriptionTypeAccepted valuesDefault
nameinput name of Dropdownstring--
optionsoptionsarray--
defaultTextdefault textstring-select

Loading

AttributeDescriptionTypeAccepted valuesDefault
typeicon typestringrotate-plane态sk-circle态sk-fading-circle态double-bounce态rect态cube态bouncerotate-plane
loadingdetermine whether it's loadingbooleantrue,falsefalse
maskwhether the mask is show or notbooleantrue,falsetrue
noTextwhether the text is show or notbooleantrue,falsefalse
texttextstring-loading...

LICENSE

MIT