0.0.9 • Published 3 years ago

vue-bootstrap-datalist v0.0.9

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

Vue Bootstrap 4 Datalist

Custom datalist with the reactivity of vue

image

Live Demo

Installation

npm install --save vue-bootstrap-datalist

Requirements

  • Bootstrap ^4 (only css)
  • jQuery >=1.8.3

Usage Example

<template>
  <VBDatalist
    :options="options"
    v-model="selected"
    placeholder="Select an option"
    value="id"
    text="name"
  />
</template>
import "bootstrap/dist/css/bootstrap.css";
import VBDatalist from "vue-bootstrap-datalist";
import "vue-bootstrap-datalist/lib/index.css";

import { ref } from "vue";

export default {
  components: {
    VBDatalist,
  },
  setup() {
    const selected = ref("");

    const options = [
      {
        id: 1,
        name: "Nicaragua",
      },
      {
        id: 2,
        name: "Costa Rica",
      },
      {
        id: 3,
        name: "Panama",
      },
    ];
    return { options, selected };
  },
};
</script>

Props

NameTypeDefaultDescription
v-modelString / NumbernullThe value of the datalist
optionsArray[]Item list for the datalist
idStringGeneratedThe id of the datalist
requiredBooleanfalseWhether the datalist is required
disabledBooleanfalseWhether the datalist is disabled
placeholderStringnullThe placeholder of the datalist
valueStringvalueThe value is the property of the option object.
textStringtextIs the label is the property name of the option object.
0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago