/select2-vue

Select2 as a vue component

Primary LanguageVue

Possible usage:

(Pug/Jade)

    Select2(
      :value="inputs.thing" 
      @input="inputs.thing = arguments[0]"
      @change="inputs.thing = arguments[0]"
      label="Thing"
      name="thing-input"
    )
      option(v-for="l,key in this.things" :key="key" :value="key") {{l.name}}

(HTML)

    <Select2 
      :value="inputs.thing" 
      @input="inputs.thing = arguments[0]"
      @change="inputs.thing = arguments[0]"
      label="Thing"
      name="thing-input"
    >
      <option v-for="l,key in this.things" :key="key" :value="key">
        {{l.name}}
      </option>
    </Select2>