1.0.5 • Published 3 years ago

vue-select-picker-bootstrap v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Vue Select Picker

It's for VueJs developers for rendering selectpicker in components.

Installation

npm i vue-select-picker-bootstrap

img_2.png

Properties

proptypeDefaultDescription
defaultTitleStringNothing SelectedTitle as showing default on selectbox.
searchableBooleanfalseOptions search functionality.
disabledBooleanfalseFor disabling selectbox.
searchPlaceholderStringSearchPlaceholder on search text field.
searchNotFoundStringNo results matchedWhen option not found after search.
addClassStringnullAdd extra class for style or any other purpose if needed.

Basic Example Code:

<template>
    <VSelect
          v-model="selected"
          :options="countries"
        />
</template>
<script>
import VSelect from "@/vue-select-picker-bootstrap";
export default {
  name: "App",
  components: {
    VSelect
  },
  data() {
    return {
      countries: [
        { value: 1, text: "Pakistan" },
        { value: 2, text: "China" },
        { value: 3, text: "Bangladesh" },
        { value: 4, text: "USA" },
        { value: 5, text: "Australia" },
      ],
      selected: {value: null},
    };
  }
};
</script>

For Default Selection: Example (Bangladesh will be default selected)

export default {
  name: "App",
  components: {
    VSelect
  },
  data() {
    return {
      countries: [
        { value: 1, text: "Pakistan" },
        { value: 2, text: "China" },
        { value: 3, text: "Bangladesh" },
        { value: 4, text: "USA" },
        { value: 5, text: "Australia" },
      ],
      selected: {value: 3},
    };
  }
};

Html is supported in items text for passing icon/images or something related to html.

Example:

<script>
import VSelect from "@/vue-select-picker-bootstrap";
export default {
  name: "App",
  components: {
    VSelect
  },
  data() {
    return {
      stateOptions: [
        { value: 1, text: "<i class='fa fa-circle' style='color:green;'></i> Enable" },
        { value: 0, text: "<i class='fa fa-circle' style='color:red;'></i> Disabled" },
      ],
      selected: {value: 0},
    };
  }
};
</script>