adds component endpoint variable

This commit is contained in:
buttle 2021-10-22 12:35:42 +02:00
parent 3d8d6264db
commit 5cfebf5ef0
3 changed files with 11 additions and 11 deletions

View File

@ -5,7 +5,8 @@
</head> </head>
<body> <body>
<div data-vue-component="archive-list"> <div data-vue-component="archive-list"
data-endpoint="https://dev-archive.hangar.org/api">
</div> </div>
<script src="/dist/archive-list.js"></script> <script src="/dist/archive-list.js"></script>

View File

@ -43,12 +43,11 @@ export default {
}, },
mounted() { mounted() {
var self = this; var self = this;
axios.get('https://dev-archive.hangar.org/api/sites', { axios.get(this.endpoint +'/sites', {
}) })
.then(function (response) { .then(function (response) {
console.log(response.data) console.log(response.data)
self.sites = response.data self.sites = response.data
//self.$forceUpdate();
}) })
.catch(function (error) { .catch(function (error) {
console.log(error); console.log(error);

View File

@ -29,9 +29,9 @@ document.querySelectorAll("[data-vue-component=archive-list]")
.forEach((element) => { .forEach((element) => {
new ComponentClass({ new ComponentClass({
components: {'ArchiveList': ArchiveList}, components: {'ArchiveList': ArchiveList},
/*
propsData: { ...element.dataset }, propsData: { ...element.dataset },
props: ["endpoint", "language", "csrf_token"], props: ["endpoint"],
/*
store: store, store: store,
i18n: i18n, i18n: i18n,
*/ */