Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component does not register #29

Closed
Jdruwe opened this issue May 11, 2016 · 2 comments
Closed

Component does not register #29

Jdruwe opened this issue May 11, 2016 · 2 comments

Comments

@Jdruwe
Copy link

Jdruwe commented May 11, 2016

I am very interested in this library but I am experiencing some issues integrating it into my vue-cli generated + vue-loader project:

main.js (NOTE: keen-ui was installed using npm):

import Vue from 'vue'
import Keen from 'keen-ui'
import VueRouter from 'vue-router'
import App from './components/App'
import CountriesView from './components/CountriesView'

Vue.use(VueRouter, Keen)

var router = new VueRouter()

router.map({
  '/countries': {
    component: CountriesView
  }
})

router.redirect({
  '*': '/countries'
})

router.start(App, '#app')

app.vue

<template>
  <div id="wrapper">
    <ui-button type="normal" color="success">Default</ui-button>
    <router-view></router-view>
  </div>
</template>

<script>
  import store from './../vuex/store'

  export default {
    name: 'App',
    store: store
  }
</script>

<style lang="scss">
  @import '~keen-ui/dist/keen-ui.css';
</style>

I keep getting the following error in the console:

vue.common.js?e881:987[Vue warn]: Unknown custom element: <ui-button> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

I am not sure why I keep getting these errors because I just followed the ES6 way of configuring keen according to the github documentation. Any ideas?

@JosephusPaye
Copy link
Owner

Hi, I think the problem is in the way you're calling Vue.use(), since it doesn't take several plugins at once, and the second argument is options that you pass to the plugin that's being installed.

You can switch to this and it should work:

Vue.use(VueRouter);
Vue.use(Keen);

@Jdruwe
Copy link
Author

Jdruwe commented May 12, 2016

Thank you! That did the job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants