项目作者: lijukrks

项目描述 :
vuex-dropdown is a simple vuejs dropdown component
高级语言: JavaScript
项目地址: git://github.com/lijukrks/vuex-dropdown.git
创建时间: 2018-06-07T15:57:25Z
项目社区:https://github.com/lijukrks/vuex-dropdown

开源协议:

下载


vuex-dropdown

A vue.js dropdown component

Image of Yaktocat

Installation of vuex-dropdown

  1. npm i --save vuex-dropdown

Browser

Include the script file

  1. <script type="text/javascript" src="node_modules/vuejs/dist/vue.min.js"></script>
  2. <script type="text/javascript" src="node_modules/vue-dropdown/dist/vuex-dropdown.min.js"></script>

Browser Usage

then install the component with Vue.use(VuexDropdown);

  1. <script type="text/javascript">
  2. Vue.use(VuexDropdown);
  3. </script>

Module

  1. import VuexDropdown from 'vuex-dropdown';

Module Usage

Once installed, it can be used in a template as simply as:

  1. <VuexDropdown
  2. v-on:onSelect="handleChangedropdown($event)"
  3. v-bind:options="options"
  4. v-bind:selected="selected"
  5. v-bind:classNames="['wrapper']"></VuexDropdown>

Options

  1. [
  2. {
  3. label: "Heck",
  4. value: "heck"
  5. },
  6. {
  7. label: "Jane",
  8. value: "jane"
  9. }
  10. ]

Selected

  1. {
  2. label: "Heck",
  3. value: "heck"
  4. }

classNames

The classnames to wrapp the component

  1. ["wrapper"]

Example - Build Setup

  1. # install dependencies
  2. npm install
  3. # serve with hot reload at localhost:8080
  4. npm run dev
  5. # build for production with minification
  6. npm run build
  7. # build for production and view the bundle analyzer report
  8. npm run build --report

For a detailed explanation on how things work, check out the guide and docs for vue-loader.

License

MIT © Liju Kuriakose