forked from cabbagelol/bfban-app-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnews-app.html
82 lines (74 loc) · 2.59 KB
/
news-app.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="https://bootswatch.com/4/solar/bootstrap.css" media="screen">
<link rel="stylesheet" href="https://bootswatch.com/_assets/css/custom.min.css">
<link rel="icon" href="https://bfban.com/favicon.ico">
<title>新闻</title>
<style>
html, body {
margin: 0;
padding: 0px;
background-color: #111b2b !important;
}
#app {
background-color: rgba(0, 0, 0, 0.2) !important;
padding: 20px 20px !important;
margin: 0px !important;
padding-top: constant(safe-area-inset-top);
padding-top:env(safe-area-inset-top);
}
.border-bottom {
border-bottom: 1px solid #dee2e605 !important;
}
</style>
<body>
<div class="my-3 p-3 bg-white rounded shadow-sm" id="app">
<div class="media text-muted pt-3" v-for="i of data">
<svg class="bd-placeholder-img mr-2 rounded" width="32" height="32"
xmlns="http://www.w3.org/2000/svg"
preserveAspectRatio="xMidYMid slice" focusable="false" role="img"
aria-label="Placeholder: 32x32"><title>
Placeholder</title>
<rect width="100%" height="100%" fill="#6f42c1"></rect>
<text x="50%" y="50%" fill="#6f42c1" dy=".3em">32x32</text>
</svg>
<div class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray">
<strong class="d-block text-gray-dark">@{{i.username}}</strong>
<p style="margin: 0" style="white-space: pre-wrap" v-for='v of i.content'>{{v.toString()}}</p>
<p>发布于 {{i.time}}</p>
</div>
</div>
</div>
</body>
</head>
</html>
<!-- JS, baidu.com -->
<script src="./js/baidu.js" type="text/javascript"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.20.0-0/axios.min.js"></script>
<script type="text/javascript">
/**
* 就这样吧,懒的构建一个完整本地项目
*/
var app = new Vue({
el: '#app',
data: {
data: [],
},
created() {
const self = this;
axios({
method: 'get',
url: './json/news.json',
headers: {
'Content-Type': 'application/json',
},
}).then(function (response) {
self.data = response.data.news;
});
}
});
</script>