# 手写VueX **Repository Path**: cede-lf/headlines ## Basic Information - **Project Name**: 手写VueX - **Description**: 手写实现Vuex、Router的功能 - **Primary Language**: HTML - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-09-22 - **Last Updated**: 2023-02-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Vuex ## 手写 vuex ## 使用 ## 分析 vuex 插件 vue.use 方法 # 手写基本功能 ### install ### store //modules 模块 // 变成树型结构 // 收集 属性 {actions:[a,b,c]} //命名空间 在你的 key 之前添加 字符串 //{actions:[fn,fn,fn]} //手写 vuex 1 (基础) state getter mutations actions 设计模式 vuex 单例模式 Store 定阅发布 2: 模块 : (1) 将用户传入的数据 变成树型结构 { _raw:{},_children:{a},state:} (2) 收集属性 {actions:[]} (3) state computed (4) vuex数据保存 (5)命名空间 (6)辅助函数 vue插件 vue.use install //全家桶 vue2 源码 面试 =》 vue 全家桶 全局使用 组件 // 优化=》 data 展示 vue4 好处 3-4 vue3 // 源码分析 可以 Vue.use(Vuex)//插件//1执行这个方法 //2如果这个方法中有一个 install这个属性这个属性是一个方法会执行这个方法//3这个install 如果他有参数第一个参数就是 vue的实例