Closed andysay closed 6 years ago
Have you try v-html="message.content | truncate(50)"
(only 1 |
)?
yeah, i'm try , but not work ;(
You cannot use vue-truncate-filter
with v-html
: https://github.com/vuejs/vue/issues/4352#issuecomment-263976170
You can truncate your message before putting in v-html
via:
this.$options.filters.truncate(message.content, 50)
Why this inconsistency where i can use filter in bindings (https://vuejs.org/v2/guide/filters.html#ad) but am not able to use it in v-html or v-text?
You can read about it https://vuejs.org/v2/guide/migration.html#Filters-Outside-Text-Interpolations-removed
okay, got it .. but why is the old/removed filter syntax still inside the docs (see the link i posted above)?
thx for answering!
@kakulukia It still there, but do not apply to v-html anymore!
its very sad, tho :/
Hi author ! how use with v-html?
v-html="message.content || truncate(50) "> not work, thanks!