v-html expects a String; not an expression; besides, why would you expect the first 100 characters of an arbitrary HTML content to be valid HTML at all?
@KikoLdasd my point is (i) v-html takes a String and (ii) you cannot guarantee that the first 100 characters are valid HTML - if you only have text content then use v-text directive instead, and pass to it a computed property which gets the first 100 characters.
function extractContent(html) {
return new DOMParser()
.parseFromString(html, "text/html")
.documentElement.textContent;
}
But, instead of using the extractContent function each time inside v-html. I would suggest to store summary of your html content in excerpt column in the database table, when creating or editing. Then, load the excerpt directly where needed.