简体   繁体   中英

How can I avoid the “Attribute v-b-modal is not allowed here” warning in Intellij IDEA?

In a Vue.js project I am using learning to use Modals from BootstrapVue. In my code I have a file Items.vue with something like this:

<div v-b-modal="'modal-' + query.id">     // this is line 15
    ...
</div>

<b-modal :id="'modal-' + query.id">
    <p class="my-4">
        hello
    </p>
</b-modal>

It works well. However, Intellij IDEA with the Vue.js plugin keeps beeping with the Warning:

Warning:(15, 5) Attribute vb-modal is not allowed here

The thread Vue Attribute is not allowed here suggests that this happens with non-.vue files, but it is not the case here.

Replacing vb-modal="..." with :vb-modal="..." (that is, with : before the attribute to make the binding more explicit) removes the warning, but then the code does not work.

I am working with Intellij IDEA 2018.1.8.

IDEA version you are using is very old, Vue.js support has been significantly improved since v. 2018.1. In particular, WEB-38028 was fixed in 2019.2. Please consider upgrading IDEA to the most recent version, BootstrapVue directives are correctly recognized there

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM