Vue.js не работает при вызове mix.react и mix.js с помощью Laravel Mix.
Однако комментирование mix.react приводит к правильной работе Vue.js.
Ты знаешь почему?
РАБОТА (webpack.mix.js)
let mix = require('laravel-mix');
mix.js('src/resources/assets/vuejs/app.js', 'src/assets/js/vue_app.js');
// mix.react('src/resources/assets/js/app.js', 'src/assets/js/react_app.js');
Журнал консоли
[Vue warn]: Failed to mount component: template or render function not defined.
found in
---> at src/resources/assets/vuejs/components/Notification.vue
НЕ РАБОТАЕТ (webpack.mix.js)
let mix = require('laravel-mix');
mix.js('src/resources/assets/vuejs/app.js', 'src/assets/js/vue_app.js');
mix.react('src/resources/assets/js/app.js', 'src/assets/js/react_app.js');
HTML
<html>
<body>
<div id = "app">
<h1>Test</h1>
<notification>
slot message
</notification>
</div>
{{ asset_js('vue_app.js') }}
</body>
</html>
SRC / ресурсы / активы / vuejs / app.js
import Vue from "vue";
import Notification from "./components/Notification.vue";
new Vue({
el: '#app',
components: {Notification},
});
SRC / ресурсы / активы / vuejs / компоненты / Notification.vue
<template>
<div class = "notification">
{{ body }}
<p>
<slot></slot>
</p>
</div>
</template>
<script>
export default {
name: 'notification',
data() {
return {
body: 'I am a notification.'
}
}
}
</script>
<style>
.notification {
background: red;
}
</style>



![Безумие обратных вызовов в javascript [JS]](https://i.imgur.com/WsjO6zJb.png)


Я обнаружил аналогичную проблему, временно заменил mix.js на mix.react. github.com/JeffreyWay/laravel-mix/issues/1627