Answer the question
In order to leave comments, you need to log in
How to inherit JSON vue objects?
Laravel turns out to have strong plus default support for Vue. I understand with her. Everything is clear only when it came to the practice of webpack swears
so I inherit json
import apiWorkers from '/workers.api'; // адресс url из laravel полный путь тоже не пашет
export default {
data(){
return{
btn_txt: "Искать",
apiWorkers
}
}
}
<script>
import apiWorkers from './workers.json'; //обычный файл в той же папке
export default {
data(){
return{
btn_txt: "Искать",
apiWorkers
}
}
}
</script>
Answer the question
In order to leave comments, you need to log in
I may not understand something, but usually all sorts of "JSON files" are provided by the API that you write on the backend and they definitely do not get into the assembly, but are requested by AJAX.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question