Laravel Mix and Vue custom Loader (iView)

594 Views Asked by At

I'm kinda new to programming with frameworks like VueJs and webpack is completely new for me. Right now we are working with Laravel 5.6 and laravel mix. I don't know if vue-loader is already in laravel.mix but I'm using a Vue Component Framework called iView and I need to load a custom Loader according to their page how to set it up: https://www.iviewui.com/docs/guide/iview-loader-en

The problem is it just doesn't work.

Nothing gets rendered and I get this error everytime:

[Vue warn]: Failed to mount component: template or render function not defined.

Here's my webpack.mix.js

mix.webpackConfig({
  module: {
    rules: [
      {
        test: /\.vue$/,
        use: [
          {
            loader: 'vue-loader',
            options: {

            }
          },
          {
            loader: 'iview-loader',
            options: {
              prefix: true
            }
          }
        ]
      }
    ]
  }
})

But when I remove the section with loader: 'vue-loader' then everything gets rendered as it should but the custom loader is still not working since I get errors like this when using the kebap case name.

[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

Anyone good at Laravel who knows how to solve this? Thanks in advance. cheers

0

There are 0 best solutions below