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

Directive doesn't register inside of <router-view>? #11

Closed
robmpreston opened this issue Sep 4, 2016 · 14 comments
Closed

Directive doesn't register inside of <router-view>? #11

robmpreston opened this issue Sep 4, 2016 · 14 comments

Comments

@robmpreston
Copy link

I'm having an issue... I register using Vue.use(VeeValidate)... If I look at the root component and my navbar component, i see the error object but on the router-view the error object does not exist and using v-validate gives a warning that the directive was not found.

Any thoughts?

@logaretm
Copy link
Owner

logaretm commented Sep 4, 2016

Can you tell me which dist are you using (1.x or 2.x)? and if you are using the latest version or not?

I will setup a simple test and get back to you.

@logaretm
Copy link
Owner

logaretm commented Sep 4, 2016

Okay I just setup a small test and it appears its working properly, can you give a code snippet of your setup?

@robmpreston
Copy link
Author

robmpreston commented Sep 4, 2016

Yeah Im confused...

even with just:

app.js:

import Vue from 'vue'
import VeeValidate from 'vee-validate'
import App from './vue/app.vue'
Router.start(App, '#app')

routes.js:

let routes = {
  '/forgot-password': {
    name: 'forgot',
    component:  Vue.component('forgot', require('./vue/pages/auth/forgot.vue'))
  }
}
let Router = new VueRouter({
  history: true
})
Router.map(routes)

app.vue:

<template>
  <div>
    <router-view></router-view>
  </div>
</template>

forgot.vue

<template>
    <div>
        <input type="email" v-model="forgotForm.email" placeholder="Email Address"
          v-validate data-rules="required|email">
    </div>
</template>

That's pretty much it... super stripped down example that still gives that warning

@robmpreston
Copy link
Author

You can close this... I havent figured it out, but theres a bigger problem with my setup, now its not recognizing my filters in the router-view either

@robmpreston
Copy link
Author

I lied, filter is fine, so maybe it is something weird. vue resource, vuestore, others work fine... just not vee validate

@robmpreston
Copy link
Author

Actually, as soon as I add the Vue.use(VeeValidate), my global filter stops working as well.

My versions:

"vue": "^1.0.21",
"vue-router": "^0.7.13",
"vee-validate": "^1.0.0-beta.1",

@robmpreston
Copy link
Author

If you want I can email you my project so you can take a look?

@logaretm
Copy link
Owner

logaretm commented Sep 4, 2016

Here is my test setup:

import Vue from 'vue';
import VueRouter from 'vue-router';
import VeeValidate from 'vee-validate';
import App from './App.vue';
import Foo from './Foo.vue';
import Bar from './Bar.vue';

Vue.use(VueRouter);
Vue.use(VeeValidate);

const router = new VueRouter();

router.map({
    '/foo': {
        component: Foo
    },
    '/bar': {
        component: Bar
    }
});

router.start(App, '#app');

Maybe something is wrong with your setup I'm not sure. or some conflict with the filter. sure you can email me: logaretm1@gmail.com

@robmpreston
Copy link
Author

Updated to Vue 2.0... directive errors gone, however now getting this when testing on an input:

vee-validate.js?d4ab:993 Uncaught TypeError: Cannot read property 'dataset' of null
vue.common.js?e881:4333 Uncaught TypeError: Cannot read property '_transitionClasses' of undefined

@logaretm
Copy link
Owner

logaretm commented Sep 10, 2016

the latest tagged version (2.0.0-beta.10) should fix this issue. can you confirm?

@robmpreston
Copy link
Author

All good now, thanks!

@vijaythecoder
Copy link

vijaythecoder commented Sep 14, 2016

I am having the same issue

"vee-validate": "^1.0.0-beta.6",
    "vue": "^1.0.21",

when I try to use

Vue.use(VeeValidate);

I get the following
[Vue warn]: Unknown custom element: <router-view> - did you register the component correctly?

@logaretm
Copy link
Owner

I'm not sure if it is the same issue, can you create a new issue or add the entry point of your app, I don't think its caused by the vee-validate plugin. you could be missing Vue.use(VueRouter);

@rstoenescu
Copy link

Still not working with Vue 1.0. Any fixes?

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

4 participants