wy-ei / vue-filter

:v: A collection of Vue.js filter. [Depressed]
MIT License
353 stars 37 forks source link

[Vue warn]: Failed to resolve filter: substring(0,20) (found in component: <body-content>) #12

Closed bonzinho closed 7 years ago

bonzinho commented 7 years ago

Hello, I do not know if I'm doing anything wrong, but when I use, for exemple, the substring (0.20) filter , I get this error: [Vue warn]: Failed to resolve filter: substring (0,20) (Found in component: ) can you help me? thank you

wy-ei commented 7 years ago

@bonzinho The reason is you didn't install the filter correctly. Please see this: Install. If it can't work please let me know. :)

bonzinho commented 7 years ago

Hi again, thanks for quick response, Sorry im noob with webpack, and in my file spa.config i do this: `require('materialize-css'); window.Vue = require('vue'); require('vue-resource'); require('vue-filter');

Vue.http.options.root = appConfig.api_url; require('./router');`

wy-ei commented 7 years ago
var Vue = require('vue');
var VueFilter = require('vue-filter');

Vue.install(VueFilter); // don't forget install

Now, I think your problem must be solved. 😃

bonzinho commented 7 years ago

I had tried, but it shows me these errors: [Filter duplication]: A filter named debouncehas has already been installed. (Anonymous) @ vue-filter.js: 2775 Vue-filter.js: 2775 [filter duplication]: A filter named uppercasehas already been installed. (Anonymous) @ vue-filter.js: 2775 Vue-filter.js: 2775 [filter duplication]: A filter named lowercasehas already been installed. (Anonymous) @ vue-filter.js: 2775 Spa.js: 10 Uncaught TypeError: Vue.install is not a function At Object. (spa.js: 10) At webpack_require (bootstrap efbb9be ...? 3158: 555) At fn (bootstrap efbb9be ...? 3158: 86) At Object. (bootstrap efbb9be ...? 3158: 578) At webpack_require (bootstrap efbb9be ...? 3158: 555) At bootstrap efbb9be ...? 3158: 578 At bootstrap efbb9be ...? 3158: 578

Thanks anyway

wy-ei commented 7 years ago

@bonzinho I don't know why you got those error message.

Spa.js: 10 Uncaught TypeError: Vue.install is not a function

Vue.install this must be a function. I can check your webpack config. I guess the problem must in there.