-
Notifications
You must be signed in to change notification settings - Fork 2
/
minimal-list.html
68 lines (67 loc) · 1.85 KB
/
minimal-list.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Project 2</title>
<link rel="stylesheet" href="./css/fonts.css">
</head>
<body>
<div id="app">
<ul>
<li v-for="language in data" :key="language.iso">
<span>[{{language.iso}}] {{ language.languageLabel }}</span> : <span>{{ language.populationQualifier || "n.a." }}</span>
</li>
</ul>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<script>
/* ************************************************** */
/* DATA ********************************************* */
var data = [
{
"iso": "epo",
"languageLabel": "Esperanto",
"languageLabelNative": "Esperanto",
"population": "2000000",
"populationQualifier": "1-10M",
"wikidata": "Q143",
},
{
"iso": "eng",
"languageLabel": "English",
"languageLabelNative": "English",
"population": "800000000",
"populationQualifier": ">100M",
"wikidata": "Q1860",
},
{
"iso": "ukr",
"languageLabel": "Ukrainian",
"languageLabelNative": "українська мова",
"population": "30000000",
"populationQualifier": "10-100M",
"wikidata": "Q8798",
},
];
/* ************************************************** */
/* VUEJS ******************************************** */
new Vue({
el: '#app',
data: {
data: data
},
mounted() {
fetch('https://hugolpz.github.io/LanguagesGallery/data/demo.json') // Repository set as public Github page, with well formated JSON data.
.then(response => response.json())
.then(data => {
this.data = data;
})
.catch(error => {
console.error('Error fetching data:', error);
});
}
});
</script>
</body>
</html>