I've installed npm install vue-truncate-filter --save for VueJs to cut extra strings for UI purpose. According to package documentation I've implemented the package step by step in my application but it's showing me error. I'm writing same steps here please guide me where I'm wrong:
1- Install vue-trauncate-filter package using npm
npm install vue-truncate-filter --save
2- include vue-trancate-filter in application
var VueTruncate = require('./node_modules/vue-truncate-filter');
Vue.use(VueTruncate)
3- Used it in my template using this code
{{ text | truncate 100 '....' }}
after implementation when I hit the url in browser it showing following error ReferenceError: require is not defined
I tried to find solution but I'm unable to solve the issue. Thanks in advance for help.