Refusal to use products.json. Switching to using the MySQL database. #12665
Unanswered
dedyukhinnp
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I'm developing an online store https://novoaroma.ru/ based on a book "Vue.js in Action" by Eric Hanchett.
In chapter 10 of the book, I successfully connected the local storage using Vuex and it worked.
I decided to stop using the "products.json" file.
I want to use a MySQL database.
I have a problem when I navigate to the file "novoaroma/store/modules/products.js" and replace the string
axios.get('static/products.json')
withaxios.get('static/fetch.php')
.After that, the site stops loading products. The console displays "undefined".
Please help me how to enable the download of products from the MySQL database (the "products" table).
the file "novoaroma/src/main.js" looks like this:
the file "novoaroma/store/store.js" looks like this:
the file "novoaroma/store/modules/products.js" looks like this:
the file "novoaroma/static/products.json" looks like this:
the file "novoaroma/static/fetch.php" looks like this:
the file "novoaroma/src/components/Main.vue" looks like this:
Beta Was this translation helpful? Give feedback.
All reactions