makes axios call to remote api
This commit is contained in:
parent
8a4693a46f
commit
459b6b0031
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div data-vue-component="archive-list">
|
||||
</div>
|
||||
<script src="/dist/archive-list.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
<!--
|
||||
http-server -o
|
||||
-->
|
|
@ -4,6 +4,7 @@
|
|||
"description": "List arc-hive collections for Omeka",
|
||||
"main": "webpack.config.js",
|
||||
"devDependencies": {
|
||||
"axios": "^0.23.0",
|
||||
"babel-loader": "^8.2.3",
|
||||
"vue": "^2.6.14",
|
||||
"vue-loader": "^15.9.8",
|
||||
|
|
|
@ -8,17 +8,28 @@ This file is part of ArciveList.
|
|||
|
||||
<template>
|
||||
|
||||
<div>
|
||||
<h1>
|
||||
List of sites
|
||||
</h1>
|
||||
<div v-for="site in sites" :key="site.id">
|
||||
{{ site.title }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
sites: Array,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
@ -28,7 +39,16 @@ export default {
|
|||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
var self = this;
|
||||
axios.get('https://collections.arc-hive.zone/api/sites', {
|
||||
})
|
||||
.then(function (response) {
|
||||
self.sites = response.data
|
||||
//self.$forceUpdate();
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
This file is part of LiberaForms.
|
||||
This file is part of ArchiveList.
|
||||
|
||||
# SPDX-FileCopyrightText: 2021 LiberaForms.org
|
||||
# SPDX-FileCopyrightText: 2021 Hangar.org
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
|
|
Loading…
Reference in New Issue