Hi there,
I want to override some of the core blocks (heading, text, list) with some additional features. (e.g. text-orientation for text and heading block and custom list-icons for the list-block)
I know that it is possible in a simple way by adding blueprints with custom fields and adapted snippets in the folder blocks - this is the way I did it until now.
Now I’d like to go a step further and also change the previews of the blocks. According to what I read about it, I can build a block-plugin by getting all the parts (vue-component, blueprint, snippet) from the block documentation and adapt everything to my needs.
But when I e.g. do it with the text-block I come along with some problems/questions:
1.) In the original vue-compontent there are for e.g. these lines:
<script>
import Block from "./Default.vue";
/**
* @displayName BlockTypeText
*/
export default {
extends: Block,
emits: ["open", "split", "update"],
computed: {
I have to delete the “import Block from “./Default.vue”;”-Line for the build-process to work, but is it right to do this? does it affect the functionality?
Same with the “extends:“ and “emits:“ lines. I don’t understand what they do and if they are important, because in the guide/cookbook I didn’t read something about it…
2.) I get the new alignment-functionality of the text-block to work by adding inline-style to the component, but adding a data-attribute with the fontsize (to work with it in the css-part) doesn’t work. ![]()
<template>
<component
:is="component"
ref="input"
v-bind="textField"
:disabled="disabled"
:keys="keys"
:value="content.text"
class="k-block-type-text-input"
:style="'text-align: ' + content.align"
:data-fontsize="content.fontsize"
@input="update({ text: $event })"
/>
</template>
I would be really happy if someone could explain me these things, and I think it would be great if there would be a cookbook-recipe with overriding core-block AND there preview.
Thanks a lot!
Matthias