-
Notifications
You must be signed in to change notification settings - Fork 51
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
Failed to resolve directive: touch #30
Comments
Maybe I got your point, but I didn't use ES6's if (typeof module === 'object') {
- module.exports = vueTouchEvents
+ exports.install = vueTouchEvents.install
+ exports.vueTouchEvents = vueTouchEvents
} |
It sill behave the same 😕 |
You're right. I should restructure the code to separate the export const directive = {
options: defaultOptions,
bind,
update: bind,
unbind (el) {
destroyTooltip(el)
},
} Why does |
This is the default directive that vue can use in the props: {
...
},
directives: {
focus: {
// directive definition
inserted: function (el) {
el.focus()
}
}
} |
OK, I see. I will restructure my code to support it 😬 |
Maybe first pull my feature.. might be easier then afterwards. |
Any news on this? I am having the same problem. |
I added a commit here #39 to support custom directives, but I can't make sure it can work well or not 😅
|
Not sure if this is a similar issue but i get the same warning so i don't want to make a new post. Clean install of vue with the cli tool and just adding
and adding this to a div
breaks the code with
What I can do, is to run the dev server without the v-touch line, write it back into my div, do a hot reload, and then everything works like it should. 👍 |
@ptrckdev Which version did you use?
This will run |
Fixed, didnt work with Vue for a year now and put the Vue.use under new Vue() in my main.js 🙄 |
@ptrckdev Yep. You can't put |
What aspects are you uncomfortable with? It seems with the latest version of vuetify-loader (at least in our build), the v-touch directive won't work as it conflicts with their own v-touch directive. |
I had the same issue and it was caused by having 2 plugins in the same
|
It seems to be a big problem. I will resolve this issue ASAP |
Not sure if this is that same issue. When testing with vue test utils and jest I get this error for each instance of v-touch in my html:
I am importing it into my test like this:
Any idea how to fix this? |
@BrianDavidYork vue2-touch-events now exports a const vue2TouchEvents = require('vue2-touch-events');
// ...
localVue.use(vue2TouchEvents);
// ... |
Is there any option to define a custom directive when installing? I'am using Vuetify and the component "v-touch" seems to override this package. import Vue2TouchEvents from 'vue2-touch-events';
Vue.use(Vue2TouchEvents); |
Using this library into another library and then importing the 2nd library doesn't work.
We have a Modal component on the https://github.com/nextcloud/nextcloud-vue library and we wanted to use your library, though when importing the modal component on another app, we get the
Failed to resolve directive: touch
error.Though importign and using your library on the
nextcloud-vue
library is done properly:I'm guessing this is because you don't export your plugin as a ssr module or something webpack can understand and pack and bundle on other libraries. But I might be wrong! :)EDIT: I was close, this is because you do not export the directive itself but only the {install:xxx, ...} object Vue.use requires. Please check https://github.com/Akryum/v-tooltip/blob/master/src/index.js for a working example. It exports the vue directive as well so that webpack can understand how things works and include everything.
The text was updated successfully, but these errors were encountered: