1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
- <title>热榜</title>
- <meta name="referrer" content="https://open.tophub.today/hot"/>
- <script src="js/vue.min.js"></script>
- <script src="js/axios.min.js"></script>
- <style>
- body {
- margin: 0;
- padding: 10px;
- font-family: Arial, sans-serif;
- }
- #app {
- max-width: 800px;
- margin: 0 auto;
- }
- ol {
- padding-left: 20px;
- }
- li {
- margin: 10px 0;
- line-height: 1.5;
- }
- a {
- color: #333;
- text-decoration: none;
- word-break: break-word;
- }
- a:hover {
- color: #007bff;
- }
- </style>
- </head>
- <body>
- <div id="app">
- <p style="font-size: 18px; font-weight: bold; margin-bottom: 15px;">热榜</p>
- <ol>
- <li v-for="(v,i) in hotList">
- <a target="_blank" :href="v.url">{{v.sitename}}:{{v.title}}</a>
- </li>
- </ol>
- </div>
- <script>
- let url = "https://web_history.tianyunperfect.cn/api3/hot";
- new Vue({
- el: "#app",
- data: {
- hotList: []
- }, methods: {
- getHotList: function () {
- axios.get(url).then(res1 => {
- let res = res1.data;
- if (res.status == 200) {
- this.hotList = res.data.items;
- }
- });
- },
- },
- mounted: function () {
- this.getHotList();
- },
- });
- </script>
- </body>
- </html>
|