// main js
window.chat = new Vue({ el: '#Chat', components: { chat: Vue.extend(require('./../components/chat/component.vue')) }, filters: { emoji: function(content){ return content; } } })
// chat script.js
module.exports = { components: { message: Vue.extend(require('./../components/message/component.vue')) } }
// message template
<span>{{{ message.text | emoji }}}</span>
This stuff gives me
app-1.0.4.js:12304 [Vue warn]: Failed to resolve filter: emoji (found in component: <message>)
I tried $ root.emoji and $ root.filters.emoji just for the sake of trying, but that didn't work.
So how can I do this. I really want to save the filter in main.js
source share