A
A
alexfyodrv2018-03-04 23:55:04
webpack
alexfyodrv, 2018-03-04 23:55:04

Laravel mix + vue how to compile installed component template?

After adding new plugin to vue app

<autosize-textarea value="default value"></autosize-textarea>

i am getting error in browser console

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

I understand that this error is related to the fact that I have to use the runtime assembly. I have a clean laravel 5.6 + vue 2.5.7 project and I assumed that compilation should be set to default, please tell me how to solve this problem? After adding most plugins, this error occurs, but I did not find a solution.
I saw a recommendation to add vue-loader to the webpack config, but that didn't solve the problem.
module.exports = {
    resolve: {
        alias: {
            'vue$': 'vue/dist/vue.common.js'
        }
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Nagorny, 2018-03-05
@esvils

Module connection example

import Vue from 'vue'
import autosizeTextarea from 'vue-autosize-textarea'

new Vue({
  el: '#app',
  methods: {
    onResized () {
      console.log('resized!')
    }
  },
  components: {
    'autosize-textarea': autosizeTextarea //!!!
  }
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question