2.7.0 • Published 4 months ago

@livelybone/vue-select v2.7.0

Weekly downloads
92
License
MIT
Repository
github
Last release
4 months ago

@livelybone/vue-select

NPM Version Download Month gzip with dependencies: 15kb typescript pkg.module ssr supported

pkg.module supported, which means that you can apply tree-shaking in you project

A vue select component, includes cascader

repository

https://github.com/livelybone/vue-select

Demo

https://livelybone.github.io/vue/vue-select/

Run Example

Your can see the usage by run the example of the module, here is the step:

  1. Clone the library git clone https://github.com/livelybone/vue-select.git
  2. Go to the directory cd vue-select
  3. Install npm dependencies npm i(use taobao registry: npm i --registry=http://registry.npm.taobao.org)
  4. Open service npm run dev
  5. See the example(usually is http://127.0.0.1/examples/test.html) in your browser

Installation

npm i -S @livelybone/vue-select

Register

// import all
import {SelectBase, SelectMulti, Cascader, CascaderMulti} from '@livelybone/vue-select';
// or
import * as VueSelect from '@livelybone/vue-select';

// Global register
Vue.component('select-base', SelectBase);
Vue.component('select-multi', SelectMulti);
Vue.component('cascader', Cascader);
Vue.component('cascader-multi', CascaderMulti);

// Local register
new Vue({
  components:{SelectBase, SelectMulti, Cascader, CascaderMulti}
})

Use in html, see what your can use in CDN: unpkg

<-- use what you want -->
<script src="https://unpkg.com/@livelybone/vue-select/lib/umd/<--module-->.js"></script>

Props

Common

NameTypeDefaultValueDescription
id[String, Number]none
optionsArray[]Select options
canEditBooleantrueIf it's set to false, the component can only be used for show
canSearchBooleanfalseSet to true to enable search
placeholderStringnonePlaceholder
searchPlaceholderStringtruePlaceholder of search input
popperPropsObjectdefaultPopperPropsProps of module @livelybone/vue-popper
scrollbarPropsObject{isMobile:false, maxHeight: '50vh'}Props of module @livelybone/vue-scrollbar-live
const defaultPopperProps = {
  arrowPosition: 'start',
  arrowOffsetScaling: 1,
  popperOptions: {
    placement: 'bottom-start',
    // If component is Cascader or CascaderMulti -> `positionFixed: true`
    // More options in https://popper.js.org
  },
}

SelectBase

NameTypeDefaultValueDescription
value[String, Number]none
inputWrapStyle[String, Object]none

SelectMulti

NameTypeDefaultValueDescription
valueArraynone

Cascader

NameTypeDefaultValueDescription
valueArraynone
expandTypeStringclickOptions: ['click', 'hover']. Set how to expand children options
changeOnSelectBooleanfalseIf set to true, options of all level can be selected
inputWrapStyle[String, Object]noneinput wrap style

CascaderMulti

NameTypeDefaultValueDescription
valueArraynone
expandTypeStringclickOptions: ['click', 'hover']. Set how to expand children options

Events

NameEmittedDataDescription
input[Array, String]
searchString

style

For building style, you can use the css or scss file in lib directory.

// scss
import 'node_modules/@livelybone/vue-select/lib/css/index.scss'

// css
import 'node_modules/@livelybone/vue-select/lib/css/index.css'

Or

// scss
@import 'node_modules/@livelybone/vue-select/lib/css/index.scss';

// css
@import 'node_modules/@livelybone/vue-select/lib/css/index.css';

Or, you can build your custom style by copying and editing index.scss

QA

  1. Error Error: spawn node-sass ENOENT

You may need install node-sass globally, npm i -g node-sass

2.7.0

4 months ago

2.6.5

4 years ago

2.6.4

5 years ago

2.6.3

5 years ago

2.6.2

5 years ago

2.6.1

5 years ago

2.6.0

5 years ago

2.5.0

5 years ago

2.4.4

5 years ago

2.4.3

5 years ago

2.4.2

5 years ago

2.4.1

5 years ago

2.4.0

5 years ago

2.3.0

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.3.0

5 years ago

1.2.2

5 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago