JSFiddle - React, Tailwind, and code Playground
HTML
<div id="vue">
{{foo | que}}
</div>
Vue
new Vue({
el:'#vue',
data(){
return {
foo:new Promise(resolve => {
setTimeout(()=> resolve('hej'), 500)
})
}
},
filters:{
que(promise){
return 'blah'
const obj = {}
Vue.util.defineReactive(obj, 'val', 'loading')
promise.then(result => obj.val = result)
return obj.val
}
}
})
window.Vue = Vue