feat: add zustand

This commit is contained in:
yuguangzhou
2024-07-17 00:23:10 +08:00
parent c71088a68d
commit 2e01e2eaea
6 changed files with 46 additions and 6 deletions
+2 -1
View File
@@ -31,7 +31,8 @@
"react-dom": "^18",
"react-resizable-panels": "^2.0.20",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7"
"tailwindcss-animate": "^1.0.7",
"zustand": "^4.5.4"
},
"devDependencies": {
"@types/node": "^20",
@@ -10,17 +10,19 @@ import {
import { Button } from "@/components/ui/button";
import { CalendarIcon } from "lucide-react";
import { format } from "date-fns";
import useBaseInfoStore from "@/store/useBaseInfoStore";
const BasicInfo = () => {
const [date, setDate] = useState<Date>();
const [isDateOpen, setIsDateOpen] = useState<boolean>(false);
const { name } = useBaseInfoStore();
return (
<div className="flex items-center flex-wrap gap-[16px]">
<div className="flex items-center flex-[48%] ">
<Label htmlFor="name" className="w-[80px]">
</Label>
<Input id="name" className="w-[200px] flex-1" />
<Input id="name" value={name} className="w-[200px] flex-1" />
</div>
<div className="flex items-center flex-[48%]">
<Label htmlFor="phone" className="w-[80px]">
@@ -14,6 +14,7 @@ import {
GraduationCap,
BookOpen
} from "lucide-react";
import useBaseInfoStore from "@/store/useBaseInfoStore";
const Editor = () => {
const [activeTab, setActiveTab] = useState("basic");
const basicRef = useRef(null);
@@ -22,7 +23,6 @@ const Editor = () => {
const educationRef = useRef(null);
const certRef = useRef(null);
const empolymentRef = useRef(null);
const tabList = [
{
value: "basic",
@@ -1,8 +1,7 @@
const Preview = () => {
return (
<div className="flex-1 p-[12px]">
{/* 简历编辑表单 */}
<div className="flex-1 p-[12px] h-[100vh] ">
<div className="p-[12px] h-[100%] rounded-[6px] bg-[#fff]"></div>
</div>
);
};
@@ -0,0 +1,7 @@
import { create } from "zustand";
const useBaseInfoStore = create((set) => ({
name: "001"
}));
export default useBaseInfoStore;