feat: 初始化前端项目基础架构
添加项目基础文件结构,包括Vue3+TypeScript配置、路由管理、状态管理和基础页面组件
This commit is contained in:
79
src/Views/herde.vue
Normal file
79
src/Views/herde.vue
Normal file
@@ -0,0 +1,79 @@
|
||||
<template>
|
||||
<div id="header">
|
||||
<div id="header-profile">
|
||||
<div id="header-profile-left">
|
||||
<!-- 登录 注册 -->
|
||||
<Button type="primary" @click="router.push('/login')">登录</Button>
|
||||
<Button type="primary" @click="router.push('/register')">注册</Button>
|
||||
</div>
|
||||
<div id="header-profile-right">
|
||||
<!-- 购物车 个人中心 -->
|
||||
<Button type="primary" @click="router.push('/cart')">购物车</Button>
|
||||
<Button type="primary" @click="router.push('/user')">个人中心</Button>
|
||||
</div>
|
||||
</div>
|
||||
<Row id="header-nav-row">
|
||||
<Col :span="4">
|
||||
<a href="/">TaoTaoWang</a>
|
||||
</Col>
|
||||
<Col :span="16">
|
||||
<a-input-search v-model:value="value" placeholder="请输入" style="width: 200px"
|
||||
@search="onSearch" />
|
||||
</Col>
|
||||
<Col :span="4">
|
||||
<a href="/product">商品列表</a>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { Button, Col, Row ,Space } from 'ant-design-vue';
|
||||
const router = useRouter()
|
||||
// 定义搜索框绑定的变量
|
||||
const value = ref('')
|
||||
// 定义搜索框的搜索事件
|
||||
const onSearch = (value: string) => {
|
||||
console.log('搜索关键词:', value)
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
#header {
|
||||
width: 100%;
|
||||
background-color: #f5f5f5;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #42b983;
|
||||
}
|
||||
|
||||
#header-profile {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
#header-profile-left {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#header-profile-left>button {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#header-profile-right {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#header-profile-right>button {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user