creating the controller/view/api base

This commit is contained in:
SimonGschnell
2023-11-14 11:52:45 +01:00
parent 8e3939a885
commit 5b385d376e
7 changed files with 165 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
import Profil from "../../components/Cis/Profil/Profil.js";
import fhcapifactory from "../api/fhcapifactory.js";
Vue.$fhcapi = fhcapifactory;
const app = Vue.createApp({
components: {
Profil,
},
data() {
return {
stunden: [],
events: null
}
},
methods: {
testsearch: function() {
return Vue.$fhcapi.UserData.getUser();
}
},
});
app.mount('#content');
+13
View File
@@ -0,0 +1,13 @@
<?php
function getUser(){
echo "test";
}
class Dummy extends Auth_Controller
{
}
?>
+3 -1
View File
@@ -1,5 +1,7 @@
import Search from "./search.js";
import UserData from "./userdata.js";
export default {
"Search": Search
"Search": Search,
"UserData": UserData
};
+13
View File
@@ -0,0 +1,13 @@
export default {
getUser: function() {
const url = FHC_JS_DATA_STORAGE_OBJECT.app_root
+ 'Cis/Profil/getUser';
return axios.get(url);
},
getUserDumy: function(){
const url = FHC_JS_DATA_STORAGE_OBJECT.app_root
+ 'public/js/apps/api/dummyapi.php/getUser';
return axios.get(url);
}
};
+27
View File
@@ -0,0 +1,27 @@
export default {
data: function() {
return {
person: null,
}
},
methods: {
testsearch: function() {
}
},
created(){
this.$parent.testsearch().then((res) => {
this.person = res.data;
});
},
template: `
<div>
<h1>test</h1>
<code>{{JSON.stringify(person)}}</code>
</div>
`,
};