devstark-com / vue-textarea-autosize

Vue component provides textarea with automatically adjustable height and without any wrappers and dependencies
MIT License
125 stars 39 forks source link

Doesn't work with Vue Version 2.5.7 #19

Closed ronakprogrammer closed 5 years ago

ronakprogrammer commented 5 years ago

Hello,

I just installed this component and it looks like this plugin doesn't work with vue version 2.5.7.I am getting error like "Failed to mount component: template or render function not defined." Package.json file looks like this

"devDependencies": { "axios": "^0.17", "bootstrap": "^4.1.3", "bootstrap-sass": "^3.3.7", "cross-env": "^5.1", "jquery": "^3.2", "laravel-mix": "^1.0", "lodash": "^4.17.4", "vue": "^2.5.7" }, "dependencies": { "laravel-vue-pagination": "^2.1.0", "popper.js": "^1.14.4", "vue-infinite-loading": "^2.3.3", "vue-multiselect": "^2.1.3", "vue-router": "^3.0.2", "vue2-daterange-picker": "^0.1.6" }

Does this support the vue version 2.5 or higher?

Thanks, Ronak

VictorCazanave commented 5 years ago

I use it with vue 2.6.7 and it works well (except in IE11/Edge 😞 )

Saymon-biz commented 5 years ago

@ronakprogrammer it looks more like some issue with your application configuration. I close the issue but feel free to provide some way to reproduce that and we'll try to help you out.

dmbaranov commented 5 years ago

Hey @ronakprogrammer. I've faced the same problem as you. The problem is, when you importing this component with import TextareaAutosize from 'vue-textarea-autosize', you actually importing a plugin (see src/index.js), not Vue component itself, that's why you got this error. Instead, you should import it once in your main.js file, use Vue.use(TextareaAutosize); and use it without imports in all your components.

@devstark-com just wondering, what was the reason behind making this component global? Why not to export component itself?