I have a K-writer feild in my block preview (in index.js)
<k-writer :inline="true" :marks="false" :placeholder="field('header').placeholder" :value="content.header" class="text-tint1 mono k-writer k-block-type-text-input" @input="update({ header: $event })" />
How do I only show this field if it has been filled out?
Use v-if to show the component conditionally.
v-if
<k-writer v-if="content.header" :inline="true" :marks="false" :placeholder="field('header').placeholder" :value="content.header" class="text-tint1 mono k-writer k-block-type-text-input" @input="update({ header: $event })" />
However, since you would usually use a writer field in your preview so that the user can enter content without having to open the drawer, this seems a bit weird. To only display the contents of this field, you don’t need the writer component?
thanks! it works for this as it’s an option you setup when you add a block