Vue警告]:无法解析指令:bin

时间:2017-07-03 12:57:49

标签: javascript vuejs2 vue-component

我是VueJS的新手。 嗨,虽然我的应用程序正在工作,我在我的控制台中收到此错误阻止jQuery。

v-for =“消息中的消息”循环遍历该对象并尝试显示该对象。但得到此错误Vue警告]:无法解析指令:bin

<li v-for="message in messages" class="conversation-item">
<div class="" v-bind:class="message.direction" id="direction" title="other">
    <div class="conversation-avatar">
        <img class="rounded"
          width="36" height="36"
          src="assets/images/messenger-img.jpg"
          alt="">
        </div>
    <div v-if="message.contentType == 'file'" class="conversation-messages">
        <div class="conversation-message">
            <a class="file-link" :href="message.content" :title="message.fileName" :download="message.fileName">
                <div v-if="message.fileType == 'fileType'" class="message file-thumbnail" v-bind:style='{ backgroundImage: "url(" + message.content + ")", }'>
                </div>
                <div v-else class="message.file-thumbnail" v-bind:style='{ backgroundImage: "url(" + message | filterFile + ")", }'>
                </div>
                <div class="file-info"> 
                    <span class="file-name">@{{ message.fileName }}</span> 
                </div>
            </a>
            </div>
        <div class="conversation-timestamp">@{{ message.sentAt }}
        </div>
    </div>
    <div v-else class="conversation-messages">
        <div class="conversation-message">
            <a target="_blank" class="other_chat"></a><span>
                @{{ message.content  }}
            </span></div>
        <div class="conversation-timestamp">@{{ message.sentAt }}
        </div>
    </div>
</div>
</li>
实际上这是一个laravel刀片所以不要担心@ sign

screeshot of console

1 个答案:

答案 0 :(得分:5)

添加v-bind指令后我遇到了同样的错误。转出来,我有一个错字,而不是 v-bind 我有 v-bin

将来,如果我收到“Failed to resolve directive:X”消息,我会在源代码中查找字符串 v-X