Haixing-Hu / vue-select

A Vue.js component implementing the select control with the jQuery select2 plugin.
http://haixing-hu.github.io/vue-select/
MIT License
133 stars 30 forks source link

Not working in vue2 need some help this is my code... #16

Open racielbd opened 4 years ago

racielbd commented 4 years ago

not working in vue2 this is my code...

<template>
  <div>
    <div class="form-group">
        <label for="select2" class="col-sm-3 control-label">   
            A searchable select with names and localized in en-US:
         </label>
         <div class="col-sm-5">
               <vue-select
                  class="vue-select2"
                  name="select2"
                  :options="options2"
                  :model.sync="result2"
                  :searchable="true"
                  language="en-US"
                >
                </vue-select>
           </div>
           <div class="col-sm-4">
                <p class="form-control-static">
                       Selected Result: <span class="vue-result2">{{ result2 }}</span>
                </p>
           </div>
     </div>
  </div>
</template>
<script>
export default {
   components: {
    "vue-select": require("vue-select2")
   },
   data() {
        return {
           serverErrors: {},
           result2: '',
           options2: [
                 {
                    text: 'name1',
                    value: 'value1',
                  },
                  {
                     text: 'name2',
                     value: 'value2',
                   },
             ],
         }
     }
}
</script>

bud got this..

[Vue warn]: Failed to mount component: template or render function not defined.
found in
---> <VueSelect>

imagen

Originally posted by @racielbd in https://github.com/Haixing-Hu/vue-select/issues/11#issuecomment-649785698

duepi commented 4 years ago

+1

balaram26 commented 4 years ago

@racielbd did u find any solutions? i have the same issue.

sugarman9907 commented 3 years ago

Try this. https://www.npmjs.com/package/v-select2-component