kos/web/src/App.vue

40 lines
703 B
Vue
Raw Normal View History

2023-01-14 14:58:21 +08:00
<template>
2023-01-14 23:33:53 +08:00
<div>Bot昵称{{ bot_name }}</div>
<div>Bot战力{{ bot_rating }}</div>
<router-view />
2023-01-14 14:58:21 +08:00
</template>
2023-01-14 23:33:53 +08:00
<script>
import $ from "jquery";
import { ref } from "vue";
2023-01-14 23:33:53 +08:00
export default {
name: "App",
setup: () => {
let bot_name = ref("");
let bot_rating = ref("");
2023-01-14 23:33:53 +08:00
$.ajax({
url: "http://localhost:3000/pk/getbotinfo/",
type: "get",
success: (resp) => {
// console.log(resp);
bot_name.value = resp.name;
bot_rating.value = resp.rating;
},
});
2023-01-14 23:33:53 +08:00
return {
bot_name,
bot_rating,
};
},
};
</script>
<style>
body {
background-image: url("@/assets/background.png");
background-size: cover;
2023-01-14 14:58:21 +08:00
}
</style>