Browse Source

ready project

master
maochaoying 2 years ago
parent
commit
0e9d8e3d04
  1. 2
      index.html
  2. 6
      src/App.vue
  3. 33
      src/components/Count.vue
  4. 7
      src/pages/Home.vue
  5. 7
      src/pages/Ready.vue
  6. 8
      src/router/index.js
  7. 5
      yarn.lock

2
index.html

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue</title>
<title>Ecmo</title>
</head>
<body>
<div id="app"></div>

6
src/App.vue

@ -1,9 +1,7 @@
<script setup>
import Count from 'cpns/Count'
</script>
<script setup></script>
<template>
<Count />
<router-view></router-view>
</template>
<style scoped></style>

33
src/components/Count.vue

@ -1,33 +0,0 @@
<template>
<div class="bg">
<span>当前数值{{ countComputed }}</span>
<br />
<span>双倍数值{{ doubleCount }}</span>
<br />
<button type="primary" size="default" @click="countStore.countAdd">
+1
</button>
<button type="primary" size="default" @click="countStore.countReduce">
-1
</button>
</div>
</template>
<script setup>
import { computed, onMounted } from 'vue'
import { get15DaysWeatherByArea } from '@/api'
import { useCountStore } from '@/store'
import { storeToRefs } from 'pinia'
const countStore = useCountStore()
//
const countComputed = computed(() => countStore.count)
// storeToRefs api
const { doubleCount } = storeToRefs(countStore)
onMounted(() => {
get15DaysWeatherByArea()
})
</script>
<style scoped lang="scss">
.bg {
background: $bg-color;
}
</style>

7
src/pages/Home.vue

@ -0,0 +1,7 @@
<template>
<div>home</div>
</template>
<script setup></script>
<style lang="scss" scoped></style>

7
src/pages/Ready.vue

@ -0,0 +1,7 @@
<template>
<div>ready</div>
</template>
<script setup></script>
<style lang="scss" scoped></style>

8
src/router/index.js

@ -1,7 +1,11 @@
import { createRouter, createWebHistory } from 'vue-router'
const Home = () => import('@/pages')
const Ready = () => import('@/pages/Ready')
// 配置路由信息
const routes = []
const routes = [
{ path: '/', component: Ready },
{ path: '/home', component: Home },
]
const router = createRouter({
routes,

5
yarn.lock

@ -7,11 +7,6 @@
"resolved" "https://registry.npmjs.org/@babel/parser/-/parser-7.21.2.tgz"
"version" "7.21.2"
"@esbuild/win32-x64@0.16.17":
"integrity" "sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q=="
"resolved" "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.17.tgz"
"version" "0.16.17"
"@vitejs/plugin-vue@^4.0.0":
"integrity" "sha512-e0X4jErIxAB5oLtDqbHvHpJe/uWNkdpYV83AOG2xo2tEVSzCzewgJMtREZM30wXnM5ls90hxiOtAuVU6H5JgbA=="
"resolved" "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.0.0.tgz"

Loading…
Cancel
Save