Answer the question
In order to leave comments, you need to log in
How to disable attribute inheritance in VueJs component?
I specify inheritAttrs: false for the VueJS component.
But the classes are still assigned to the root element.
what am I doing wrong?
<template>
<div class="ui-input">
<div v-if="label" class="ui-input__label">{{ label }}</div>
<input class="ui-input__field" v-on="$listeners" v-bind="$attrs" v-bind:value="value" v-on:input="$emit('input', $event.target.value)">
</div>
</template>
<script>
export default{
name: 'ui-input',
props:....
inheritAttrs: false
}
</script>
<ui-input type="text" class="form-control form-control-lg" label="Секретный ключ"></ui-input>
Answer the question
In order to leave comments, you need to log in
I specify inheritAttrs: false <...> classes are still written to the root element
this option does not affect bindingsclass
andstyle
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question