Answer the question
In order to leave comments, you need to log in
Why does the Bitrix visual editor break the Vue component?
If you use it in the admin panel in the markup editor <my-component> Some text </my-component>
, and then switch to the visual editor, then the markup turns into <span> Some text </span>
.
Is this behavior configurable somehow? It cannot be that custom tags are not accepted.
Answer the question
In order to leave comments, you need to log in
You can set the rules for processing specific tags, then the tag itself should not be cut.
in filebitrix/php_interface/admin_header.php
<script>
BX.addCustomEvent('OnEditorInitedBefore', function(toolbar) {
var _this = this;
BX.addCustomEvent(this, 'OnGetParseRules', BX.proxy(function() {
this.rules.tags['my-component'] = {}; // с дефисом
this.rules.tags.mycomponent = {}; // без дефиса
}, this));
});
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question