FEATURE: Data fetching VUE
This commit is contained in:
parent
35aeb1a7ef
commit
e9b9af9fda
1
.env.development
Normal file
1
.env.development
Normal file
|
@ -0,0 +1 @@
|
|||
VITE_BACKEND_URI=http://127.0.0.1:3000
|
|
@ -7,6 +7,14 @@ let data = [
|
|||
}
|
||||
]
|
||||
|
||||
function fetchEvents() {
|
||||
console.log(import.meta.env.VITE_BACKEND_URI)
|
||||
fetch(`${import.meta.env.VITE_BACKEND_URI}/api/v1/public/event`)
|
||||
.then((response) => {
|
||||
console.log(response.json())
|
||||
})
|
||||
}
|
||||
|
||||
function test() {
|
||||
this.data = 'outside'
|
||||
}
|
||||
|
@ -18,6 +26,10 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
fetchEvents()
|
||||
},
|
||||
|
||||
methods: {
|
||||
changeText() {
|
||||
this.data = 'another Test'
|
||||
|
|
Loading…
Reference in a new issue