0
나는 Vue.js에 비교적 새로운 해요 지금은 내 Laravel 응용 프로그램으로이 플러그인 vue-chat-scroll를 설치할하지만,이 오류가 발생합니다 :laravel의 VUE 가져 오기 플러그인 [VUE-채팅 스크롤]
을[Vue warn]: Failed to resolve directive: chat-scroll
(found in [ChatLog])
npm install --save vue-chat-scroll
을 성공적으로 실행했습니다.
내 package.json
는 플러그인에 대한 enty 있습니다 추가 정보에 설명 된대로 나는이 개 라인을 추가 bootstrap.js
에서
"dependencies": {
"laravel-echo": "^1.3.0",
"pusher-js": "^4.1.0",
"vue-chat-scroll": "^1.1.1"
}
. 내 ChatLog.vue
에서
window.Vue = require('vue');
import VueChatScroll from 'vue-chat-scroll'
Vue.use(VueChatScroll);
window.axios = require('axios');
window.axios.defaults.headers.common = {
'X-CSRF-TOKEN': window.Laravel.csrfToken,
'X-Requested-With': 'XMLHttpRequest'
};
은 내가 v-chat-scroll
지시어를 추가했다.
<template lang="html">
<div class="chat-log" v-chat-scroll>
<chat-message v-for="message in messages" :message="message"></chat-message>
</div>
</template>
<script >
export default{
props: ['messages']
}
</script>
무엇이 누락 되었습니까?
당신은 다시 컴파일나요 bootstrap.js에서 제거 할 수 있습니다 최적화 할 것이다 자산을'bootstrap.js'에서 참조한 후에? 또한'import ('문서에서 ES5 방식) 대신'require ('vue-chat-scroll')'시도해 볼 수도 있습니다. – Alex