darrenjennings / vue-autosuggest

🔍 Vue autosuggest component.
https://darrenjennings.github.io/vue-autosuggest
MIT License
621 stars 91 forks source link

Failed to mount component #146

Closed YolloDwarf closed 5 years ago

YolloDwarf commented 5 years ago

I get a "failed to mount component: template or render function not defined" with the following code:

[..]

{{suggestion.item.name}}

[..]

I basically copied the basic code in the README but the template won't render.

darrenjennings commented 5 years ago

You are wanting to import is as a component, but you are importing the plugin. See usage:

Load VueAutosuggest into your vue app globally.

import VueAutosuggest from "vue-autosuggest";
Vue.use(VueAutosuggest);

or locally inside a component:

import { VueAutosuggest } from 'vue-autosuggest';
export default {
  ...
  components: {
      VueAutosuggest
  }
  ...
};