在发布帖子时,我在网络控制台上收到上述错误。
源映射错误:请求失败,状态为404资源资源URL:http:// {mywebsite} /js/app.js源映射URL:bootstrap.js.map
我的资源/js/app.js看起来像这样
[const app = new Vue({
el: '#app',
data: {
msg: 'Update new Post:',
content:'',
},
methods:{
addPost(){
axios.post('myid.web/home/addPost', {
content:this.content
})
.then(function(response){
console.log(response);
})
.catch(function(error){
console.log(error);
});
}
}
});][1]
Run Code Online (Sandbox Code Playgroud)
和webpack.js看起来像这样
let mix = require('laravel-mix');
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');
Run Code Online (Sandbox Code Playgroud)
我正在尝试在我的 vue 2 项目中插入 headless ui popover 。我遇到这个错误
Uncaught TypeError: Object(...) is not a function
at eval (headlessui.esm.js?d511:670)
at Module../node_modules/@headlessui/vue/dist/headlessui.esm.js (chunk-vendors.js:23)
at __webpack_require__ (app.js:849)
at fn (app.js:151)
at eval (cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/Navigations/Navbar.vue?vue&type=script&lang=js&:5)
at Module../node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/Navigations/Navbar.vue?vue&type=script&lang=js& (app.js:998)
at __webpack_require__ (app.js:849)
at fn (app.js:151)
at eval (Navbar.vue?7538:1)
at Module../src/components/Navigations/Navbar.vue?vue&type=script&lang=js& (app.js:2161)
Run Code Online (Sandbox Code Playgroud)
我的代码看起来像这样。
<div v-if="isLoggedIn" class="flex space-x-2">
<NotificationCenter />
<Popover class="relative">
<PopoverButton>Solutions</PopoverButton>
<PopoverPanel class="absolute z-10">
<div class="grid grid-cols-2">
<a href="/analytics">Analytics</a>
<a href="/engagement">Engagement</a>
<a href="/security">Security</a>
<a href="/integrations">Integrations</a>
</div>
</PopoverPanel>
</Popover>
</div>
Run Code Online (Sandbox Code Playgroud)
在脚本内部,我像往常一样导入并添加了组件。
import { Popover, PopoverButton, PopoverPanel } …
Run Code Online (Sandbox Code Playgroud)