Hello there,
I’m having trouble updating a field on an object in my Vue component. What I’m trying to achieve is saving inline text into my object’s title, like this in my block:
fields:
title:
type: object
fields:
# … other fields …
text:
type: writer
inline: true
nodes: false
Here is my Vue component file :
// template part …
<k-writer-input
ref=“text”
:marks=“false”
:value=“content.title?.text”
placeholder=“Saisissez le surtitre…”
@input=“updateObject({ title: { …content.title, text: $event } })”
class=“k-block-type-text”/>
// script part …
methods: {
updateObject(content) {
console.log(content.title.text); // Log my text with <p> element (ex: <p>hello world</p> instead of "hello world"
this.$emit(‘update’, {
...this.content,
...content
})
},
},
I don’t understand why the log outputs my text wrapped in a <p> element instead of just the plain text.
Any idea ?
Thanks !