Answer the question
In order to leave comments, you need to log in
How to include third party library in vue/cli project?
Hello! I know this has been asked before, but I couldn't find a good answer anywhere. There is a small autosize library that takes a texarea and controls its size. Autosize is in the assets folder. The project structure is standard:
-public
-src
--assets
--components
--main.js
--app.vue
What I do:
import autosize from "../assets/autosize-master/dist/autosize.js"
...
mounted: function(){
autosize(this.$refs.textarea)
}
...
Answer the question
In order to leave comments, you need to log in
npm i autosize
In the required component:
import autosize from 'autosize';
mounted() {
autosize(this.$refs.someEl);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question