perf:基础架构升级
This commit is contained in:
12
src/main.ts
12
src/main.ts
@@ -1,11 +1,3 @@
|
||||
/*
|
||||
* @Description: {{ByRuin}}
|
||||
* @Version: 2.0
|
||||
* @Author: Ruin 🍭
|
||||
* @Date: 2022-01-25 16:22:24
|
||||
* @LastEditors: 刘引 liu.yin.work@foxmail.com
|
||||
* @LastEditTime: 2023-08-01 15:54:28
|
||||
*/
|
||||
import { createApp } from 'vue'
|
||||
import router from './router/index' //引入vue-router
|
||||
import App from './App.vue'
|
||||
@@ -20,8 +12,8 @@ import 'normalize.css/normalize.css'
|
||||
createApp(App)
|
||||
.use(router)
|
||||
.use(createPinia())
|
||||
.use(ElementPlus,{
|
||||
locale: zhCn,
|
||||
.use(ElementPlus, {
|
||||
locale: zhCn
|
||||
})
|
||||
.component('Foot', Foot)
|
||||
.component('Head', Head)
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
/*
|
||||
* @Description: {{ByRuin}}
|
||||
* @Version: 2.0
|
||||
* @Author: Ruin 🍭
|
||||
* @Date: 2022-01-25 16:57:54
|
||||
* @LastEditors: 刘引
|
||||
* @LastEditTime: 2022-03-11 14:26:24
|
||||
*/
|
||||
// import path from 'node:path/win32'
|
||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||
const routes = [
|
||||
|
||||
@@ -23,9 +23,4 @@ const getItem = (data: unknown) => {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
const HomeApi = {
|
||||
getInfo,
|
||||
getItem
|
||||
}
|
||||
export default HomeApi
|
||||
export { getInfo, getItem }
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, watch, onUpdated, ref, reactive, onBeforeMount } from 'vue'
|
||||
import news from './components/news.vue'
|
||||
import HomeApi from '@/services/home'
|
||||
import { getInfo, getItem } from '@/services/home'
|
||||
|
||||
// get请求
|
||||
const getDataFromApi = async () => {
|
||||
try {
|
||||
const res = await HomeApi.getInfo({ type: 'scorpio', time: 'today' })
|
||||
const res = await getInfo({ type: 'scorpio', time: 'today' })
|
||||
console.debug(res, '获取到的数据')
|
||||
} catch (error) {
|
||||
console.error('get获取星座数据报错', error)
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
<!--
|
||||
* @Description: {{ByRuin}}
|
||||
* @Version: 2.0
|
||||
* @Author: Ruin 🍭
|
||||
* @Date: 2022-03-10 10:11:06
|
||||
* @LastEditors: 刘引 liu.yin.work@foxmail.com
|
||||
* @LastEditTime: 2023-08-01 15:45:57
|
||||
-->
|
||||
<template>
|
||||
<div class="root-home">
|
||||
<news></news>
|
||||
|
||||
Reference in New Issue
Block a user