2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-17 02:29:37 +03:00
Files
vue-select/docs/md/Install.md
T
Jeff Sagal 201e135964 - new dedicated development template
- separate environment for developing docs
- clear out discarded couscous files
- start converting docs markdown
2017-02-01 22:32:06 -08:00

988 B

NPM Based WorkFlows

$ npm install vue-select
<template>
   <div id="myApp">
      <v-select v-model="selected" :options="options"></v-select>
   </div>
</template>

<script>
import vSelect from 'vue-select'
export default {
  components: {vSelect},
  data() {
     return {
        selected: null,
        options: ['foo','bar','baz']
     }
  }
}
</script>

Browser Globals

v1.3.0+ no longer requires any toolchain to use the component:

Just include vue & vue-select.js - I recommend using unpkg.com.

<!-- use the latest release -->
<script src="https://unpkg.com/vue-select@latest"></script>
<!-- or point to a specific release -->
<script src="https://unpkg.com/vue-select@1.30"></script>

Then register the component in your javascript:

Vue.component('v-select', VueSelect.VueSelect);

From there you can use as normal. Here's an example on JSBin.