Skip to content

mobx cause [Vue warn]: Unknown custom element: <router-link>  #31

Description

@dohoangn

It was working fine before installing and add mobx to vuejs
main.js

import Vue from 'vue/dist/vue.js'
import VueRouter from 'vue-router'

import App from './components/app/App'
import router from './routers'

Vue.use(VueRouter)
Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})

App Template:

<div id="app">
  <router-link to="/home">Home</router-link> 
  <router-view></router-view>
</div>

App Script:


import { observer } from 'mobx-vue';
import Store from '../../stores/store';

export default observer({
  name: 'app',
  components: {},
  data() {
    return { state: new Store() };
  }
});

I've got this error:

[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

vue.runtime.esm.js?2b0e:619 [Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions