I have developed two custom Vue directives to add an HTML element before or after another element. I provide an HTML string to the element where I apply the directive, but I am encountering an error in VS Code:
Parsing error: unexpected-character-in-attribute-name.eslint-plugin-vue
This is the way I am implementing it:
<rad-stack title="Final Price" v-insert-before="'<div class='RADcard3_texts_info_divider'></div>'"><p>Price: {{ item.finalPrice }} €</p></rad-stack>
The structure of my directive is as follows:
Vue.directive('insert-before', {
isLiteral: true,
inserted: (el, binding, vnode) => {
el.parentNode.insertBefore(binding.value, el);
}
});