| | |
| | | () => { |
| | | $router.push({ |
| | | path: '/home', |
| | | }); |
| | | }) |
| | | } |
| | | " |
| | | src="@/assets/images/xiehe/home/Group_303.png" |
| | |
| | | <a |
| | | @click=" |
| | | () => { |
| | | console.log(loginRef.value); |
| | | loginRef.logIn(); |
| | | console.log(loginRef.value) |
| | | loginRef.logIn() |
| | | } |
| | | " |
| | | >注册/登录</a |
| | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import login from "./login.vue"; |
| | | import { onMounted, ref } from "vue"; |
| | | import { Search } from "@element-plus/icons-vue"; |
| | | import { useUserStore } from "@/store"; |
| | | import { useRouter } from "vue-router"; |
| | | const userStore = useUserStore(); |
| | | const router = useRouter(); |
| | | import login from './login.vue' |
| | | import { onMounted, ref } from 'vue' |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { useUserStore } from '@/store' |
| | | import { useRouter } from 'vue-router' |
| | | const userStore = useUserStore() |
| | | const router = useRouter() |
| | | |
| | | const loginRef = ref(); |
| | | const loginRef = ref() |
| | | const props = defineProps({ |
| | | hideSerch: { |
| | | type: Boolean, |
| | |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | }); |
| | | }) |
| | | |
| | | let searchKey = ref(""); |
| | | let userInfo = ref(""); |
| | | let searchKey = ref('') |
| | | let userInfo = ref('') |
| | | const navData = ref([ |
| | | { |
| | | name: "首页", |
| | | path: "/home", |
| | | name: '首页', |
| | | path: '/home', |
| | | }, |
| | | { |
| | | name: "教育出版", |
| | | path: "/bookStore", |
| | | name: '教育出版', |
| | | path: '/bookStore', |
| | | }, |
| | | { |
| | | name: "读者服务", |
| | | path: "/teachingServices", |
| | | name: '读者服务', |
| | | path: '/teachingServices', |
| | | }, |
| | | { |
| | | name: "关于我们", |
| | | path: "/aboutUs", |
| | | name: '关于我们', |
| | | path: '/aboutUs', |
| | | }, |
| | | ]); |
| | | ]) |
| | | |
| | | onMounted(() => { |
| | | userInfo.value = userStore.userInfo; |
| | | console.log(userInfo.value, "userInfo"); |
| | | }); |
| | | userInfo.value = userStore.userInfo |
| | | console.log(userInfo.value, 'userInfo') |
| | | }) |
| | | |
| | | const gotoSearch = () => {}; |
| | | const gotoSearch = () => {} |
| | | const handleCommand = (item) => { |
| | | if (item === "gotoPersonalCenter") { |
| | | if (item === 'gotoPersonalCenter') { |
| | | router.push({ |
| | | path: "/personalCenter", |
| | | }); |
| | | path: '/personalCenter', |
| | | }) |
| | | } |
| | | if (item === "logout") { |
| | | localStorage.clear(); |
| | | if (item === 'logout') { |
| | | localStorage.clear() |
| | | router.push({ |
| | | path: "/home", |
| | | }); |
| | | path: '/home', |
| | | }) |
| | | } |
| | | }; |
| | | } |
| | | const gotoPage = (item) => { |
| | | router.push(item.path); |
| | | }; |
| | | router.push(item.path) |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |