[SOLVED] boot file questions
-
After rereading the boot file docs (https://quasar.dev/quasar-cli/boot-files), and looking at my
/src/boot
folder, I see files that are not in theboot: []
area ofquasar.conf.js
, but still seem to be working (axios.js
among them). Did something change in recent versions and should I make sure any file that is in the boot folder have a corresponding entry inboot: []
area ofquasar.conf.js
? -
Can you post your axios file? Boot files still need to be registered in
quasar.conf.js
.Scott
-
@ssuess depends how you are using axios. One boot setting about it, is setting up it’s Vue prototype, so you can use the this.$axios in your sfc’s.
-
@metalsadman I think that explains a lot. So if that boot file is included in the conf file, I should no longer have to do an
import axios from 'axios'
in any file I use axios in? (and instead of writing my calls asaxios.get
I should be able to usethis.$axios.get
everywhere?) -
Correct. If you bind axios to Vue’s prototype, that is what is possible in your SFCs.
https://quasar.dev/quasar-cli/boot-files#Axios
Scott