【Vue】Vue2中的Vuex

目录

  • Vuex
    • 介绍
    • Vuex 中的核心概念
  • 在vue2中使用Vuex
    • 安装 Vuex
    • 创建一个 Vuex Store
    • 在 Vue 实例中使用 Vuex
    • 编写 Vuex 的 state、mutations 和 actions
    • 在组件中使用 Vuex
  • Vuex的核心
    • State
      • 组件中获取 Vuex 的状态
      • mapState 辅助函数
      • 对象展开运算符
    • Getter
      • 基本使用
        • 示例
      • 通过属性访问
      • 通过方法访问
      • mapGetters 辅助函数
    • Mutation
      • 定义mutation
        • mutations 中回调函数参数:
      • commit 提交 mutation
      • Mutation 必须是同步函数
      • mapMutations 辅助函数
    • Actions
      • Action 函数
      • dispatch 触发 Action
      • action 内部执行异步操作
        • 购物车示例,涉及到调用异步 API 和分发多重 mutation
      • mapActions 辅助函数
      • 组合 Action
  • Modules
    • 基本使用
      • 示例:
    • 命名空间
      • 示例

Vuex

介绍

  • Vuex 是一个用于 Vue.js 应用程序的状态管理模式。
  • 它采用集中式存储管理应用的所有组件的状态,并以相应的规则保证状态的一致性。
  • Vuex 还集成了Vue的官方浏览器插件 vue-devtools,提供了一些强大的调试工具。
  • Vue 2 匹配的 Vuex 3 的文档:文档链接
    在这里插入图片描述

Vuex 中的核心概念

  1. State(状态):用于存储应用程序的状态,可以通过 this.$store.state 访问。

  2. Getters(计算属性):类似于 Vue 组件中的计算属性,可以派生出一些状态,可以通过 this.$store.getters 访问。

  3. Mutations(突变):用于修改状态,只能进行同步操作,可以通过 this.$store.commit 触发。

  4. Actions(异步操作):用于处理异步操作,可以通过 this.$store.dispatch 触发,并且可以调用多个突变。

  5. Modules(模块化):可以将 store 分割成多个模块,每个模块拥有自己的 state、getters、mutations和actions。

使用 Vuex 可以帮助我们更好地组织和管理 Vue 应用的状态,并且方便状态的复用和共享。

在vue2中使用Vuex

安装 Vuex

可以使用 npm 或者 yarn 进行安装。

npm install vuex
//或者
npm install vuex@3.0.0 --save
//或者
yarn add vuex

创建一个 Vuex Store

在src/store目录下创建一个名为 index.js 的文件,并在其中导入 Vue 和 Vuex,并创建一个新的 Vuex.Store 实例。

import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
    state: {
        count: 1
    },
    mutations: {
        increment(state, value) {
            state.count += value
        }
    }
})
export default store;

在 Vue 实例中使用 Vuex

在 main.js 文件中导入刚才创建的 index.js 文件,并在 Vue 实例的配置对象中引入 store

import Vue from 'vue'
import App from './App.vue'
import store from './store'

new Vue({
  store,
  render: h => h(App),
}).$mount('#app')

编写 Vuex 的 state、mutations 和 actions

对于需要进行状态管理的数据,可以在 store.js 文件中定义 state,并在 mutations 中编写修改 state 的方法,在 actions 中编写处理业务逻辑的方法。

export default new Vuex.Store({
     state: {
       count: 0,
     },
     mutations: {
       increment(state) {
         state.count++
       },
     },
     actions: {
       incrementAsync({ commit }) {
         setTimeout(() => {
           commit('increment')
         }, 1000)
       },
     },
   })

在组件中使用 Vuex

在需要使用 Vuex 中的状态或触发 Vuex 中 mutations/actions 的组件中,可以通过 this.$store.state 来获取 state,通过 this.$store.commit 来触发 mutations,通过 this.$store.dispatch 来触发 actions。

 <template>
     <div>
       <p>Count: {{ count }}</p>
       <button @click="increment">Increment</button>
     </div>
   </template>

   <script>
   export default {
     computed: {
       count() {
         return this.$store.state.count
       },
     },
     methods: {
       increment() {
         this.$store.commit('increment')
       },
     },
   }
   </script>

通过上述步骤,就可以在 Vue 2 中使用 Vuex 进行状态管理了。可以在组件中方便地共享和修改状态,并且处理异步操作。

Vuex的核心

State

组件中获取 Vuex 的状态

  • 在计算属性中返回某个状态:

    // 创建一个 Counter 组件
    const Counter = {
      template: `<div>{{ count }}</div>`,
      computed: {
        count () {
          return store.state.count
        }
      }
    }
    
  • 在每个需要使用 state 的组件中需要频繁地导入

  • 在根实例中注册 store 选项,该 store 实例会注入到根组件下的所有子组件中

    const app = new Vue({
      el: '#app',
     
      store, // 把 store 对象提供给 “store” 选项,这可以把 store 的实例注入所有的子组件
      
      components: { Counter },
      template: `
        <div class="app">
          <counter></counter>
        </div>
      `
    })
    
  • 子组件能通过 this.$store 访问:

    const Counter = {
      template: `<div>{{ count }}</div>`,
      computed: {
        count () {
          return this.$store.state.count
        }
      }
    }
    

mapState 辅助函数

  • 用于组件需要获取多个状态的时候

    <template>
      <div class="hello">
        <div>
          <h3>组件中使用 store</h3>
          当前count:{{ $store.state.count }}
        </div>
        <div>
          <h3>组件中使用 mapState</h3>
          <div>
            当前count:{{ count }}
          </div>
          <div>
            当前countAlias:{{ countAlias }}
          </div>
          <div>
            当前countPlusLocalState:{{ countPlusLocalState }}
          </div>
        </div>
    
        <div>
          <button v-on:click="clickCount(0)">减1</button>
          <button v-on:click="clickCount(1)">加1</button>
        </div>
      </div>
    </template>
    
    <script>
    import { mapState } from "vuex";
    
    export default {
      name: "CountView",
    
      methods: {
        clickCount(val) {
          this.$store.commit("increment", val === 0 ? -1 : 1);
        },
      },
    
      data: () => ({
        localCount: 3,
      }),
    
      computed: {
        ...mapState({
          // 箭头函数可使代码更简练
          count: (state) => state.count,
    
          // 传字符串参数 'count' 等同于 `state => state.count`
          countAlias: "count",
    
          // 使用常规函数,count + data中的localCount
          countPlusLocalState(state) {
            return state.count + this.localCount;
          },
        }),
      },
    };
    </script>
    
  • 也可以给 mapState 传一个字符串数组:

    computed: mapState([
      // 映射 this.count 为 store.state.count
      'count'
    ])
    

对象展开运算符

```js
computed: {
  localComputed () { /* ... */ },
  
  // 使用对象展开运算符将此对象混入到外部对象中
  ...mapState({
    // ...
  })
}
```

Getter

基本使用

  • 就像计算属性一样,getter 的返回值会根据它的依赖被缓存起来,且只有当它的依赖值发生了改变才会被重新计算。
示例
  • Getter 接受 2 个参数, state 作为其第一个参数,getter 作为第二个参数

    const store = new Vuex.Store({
      state: {
        todos: [
          { id: 1, text: '...', done: true },
          { id: 2, text: '...', done: false }
        ]
      },
      getters: {
        doneTodos: (state, getters) => {
          return state.todos.filter(todo => todo.done)
        }
      }
    })
    

通过属性访问

  • Getter 会暴露为 store.getters 对象,可以以属性的形式访问这些值:

    store.getters.doneTodos // -> [{ id: 1, text: '...', done: true }]
    

通过方法访问

  • 也可以通过让 getter 返回一个函数,来实现给 getter 传参

    getters: {
      // ...
      getTodoById: (state) => (id) => {
        return state.todos.find(todo => todo.id === id)
      }
    }
    
  • 使用

    store.getters.getTodoById(2) // -> { id: 2, text: '...', done: false }
    

mapGetters 辅助函数

  • mapGetters 辅助函数仅仅是将 store 中的 getter 映射到局部计算属性:

    import { mapGetters } from 'vuex'
    
    export default {
      // ...
      computed: {
      // 使用对象展开运算符将 getter 混入 computed 对象中
        ...mapGetters([
          'doneTodosCount',
          'anotherGetter',
          // ...
        ])
      }
    }
    
  • 如果你想将一个 getter 属性另取一个名字,使用对象形式:

    ...mapGetters({
      // 把 `this.doneCount` 映射为 `this.$store.getters.doneTodosCount`
      doneCount: 'doneTodosCount'
    })
    

Mutation

定义mutation

更改状态的唯一方法是提交 mutation

mutations 中回调函数参数:
  • state 为第一个参数,
  • payload(载荷)为第二个参数(可以为基本数据类型,也可以为对象)
const store = new Vuex.Store({
  state: {
    count: 1
  },
  mutations: {
     increment(state, payload) {
        state.count += payload
     }
  }
})

commit 提交 mutation

调用 store.commit 方法:

store.commit('increment', 2)

Mutation 必须是同步函数

一条重要的原则就是要记住 mutation 必须是同步函数

mutations: {
  someMutation (state) {
    api.callAsyncMethod(() => {
      state.count++
    })
  }
}
  • 原因是当 mutation 触发的时候,回调函数还没有被调用,devtools 不知道什么时候回调函数实际上被调用,这样状态的变化就变得不可追踪
  • 解决方法:使用 Actions

mapMutations 辅助函数

使用 mapMutations 辅助函数将组件中的 methods 映射为 store.commit 调用:(需要先在根节点注入 store):

import { mapMutations } from 'vuex'

export default {
  // ...
  methods: {
    ...mapMutations([
      'increment', // 将 `this.increment()` 映射为 `this.$store.commit('increment')`

      // `mapMutations` 也支持载荷:
      'incrementBy' // 将 `this.incrementBy(amount)` 映射为 `this.$store.commit('incrementBy', amount)`
    ]),
    
    ...mapMutations({
      add: 'increment' // 将 `this.add()` 映射为 `this.$store.commit('increment')`
    })
  }
}

Actions

Action 类似于 mutation,不同在于:

  1. Action 提交的是 mutation,而不是直接变更状态。
  2. Action 可以包含任意异步操作。

Action 函数

Action 函数参数

  • context 对象(与 store 实例具有相同方法和属性,因此你可以调用 context.commit 提交一个 mutation)
  • payload 载荷(可以基本数据,也可以对象)

定义

const store = new Vuex.Store({
    state: {
        count: 0
    },
    mutations: {
        increment(state, payload) {
            state.count += payload;
        }
    },
    actions: {
        increment(context, payload) {
            context.commit('increment', payload)
        }
    }
})

export default store;

dispatch 触发 Action

Action 通过 store.dispatch 方法触发:

store.dispatch('increment', 3)

action 内部执行异步操作

actions: {
  incrementAsync ({ commit }) {
    setTimeout(() => {
      commit('increment')
    }, 1000)
  }
}
购物车示例,涉及到调用异步 API 和分发多重 mutation
actions: {
  checkout ({ commit, state }, products) {
    // 把当前购物车的物品备份起来
    const savedCartItems = [...state.cart.added]
    // 发出结账请求,然后乐观地清空购物车
    commit(types.CHECKOUT_REQUEST)
    // 购物 API 接受一个成功回调和一个失败回调
    shop.buyProducts(
      products,
      // 成功操作
      () => commit(types.CHECKOUT_SUCCESS),
      // 失败操作
      () => commit(types.CHECKOUT_FAILURE, savedCartItems)
    )
  }
}

mapActions 辅助函数

使用 mapActions 辅助函数将组件的 methods 映射为 store.dispatch 调用(需要先在根节点注入 store):

import { mapActions } from 'vuex'

export default {
  // ...
  methods: {
    ...mapActions([
      'increment', // 将 `this.increment()` 映射为 `this.$store.dispatch('increment')`

      // `mapActions` 也支持载荷:
      'incrementBy' // 将 `this.incrementBy(amount)` 映射为 `this.$store.dispatch('incrementBy', amount)`
    ]),
    ...mapActions({
      add: 'increment' // 将 `this.add()` 映射为 `this.$store.dispatch('increment')`
    })
  }
}

组合 Action

Action 通常是异步的,那么如何知道 action 什么时候结束呢?更重要的是,我们如何才能组合多个 action,以处理更加复杂的异步流程?
首先,你需要明白 store.dispatch 可以处理被触发的 action 的处理函数返回的 Promise,并且 store.dispatch 仍旧返回 Promise:

actions: {
  actionA ({ commit }) {
    return new Promise((resolve, reject) => {
      setTimeout(() => {
        commit('someMutation')
        resolve()
      }, 1000)
    })
  }
}

现在这么写

store.dispatch('actionA').then(() => {
  // ...
})

在另外一个 action 中也可以:

actions: {
  // ...
  actionB ({ dispatch, commit }) {
    return dispatch('actionA').then(() => {
      commit('someOtherMutation')
    })
  }
}

最后,如果我们利用 async / await (opens new window),我们可以如下组合 action:

// 假设 getData() 和 getOtherData() 返回的是 Promise
actions: {
  async actionA ({ commit }) {
    commit('gotData', await getData())
  },
  async actionB ({ dispatch, commit }) {
    await dispatch('actionA') // 等待 actionA 完成
    commit('gotOtherData', await getOtherData())
  }
}

Modules

基本使用

  • Vuex 允许我们将 store 分割成模块(module)
  • 每个模块拥有自己的 state、mutation、action、getter

示例:

store/modules/moduleA.js

const moduleA = {
    state: {
        countA: 1
    },
    getters: {},
    mutations: {},
    actions: {}
}

export default moduleA;

store/modules/moduleB.js

const moduleB = {
    state: {
        countB: 2
    },
    getters: {
        sumWithRootCount(state, getters, rootState) {
            // 这里的 state 和 getters 对象是模块的局部状态,rootState 为根节点状态
            console.log('B-state', state)
            console.log('B-getters', getters)
            console.log('B-rootState', rootState)
            return state.countB + rootState.count
        }

    },
    mutations: {
        increment(state, payload) {
            // 这里的 `state` 对象是模块的局部状态
            state.countB += payload;
        }
    },
    actions: {
        incrementIfOddOnRootSum({ state, commit, rootState }, payload) {
            console.log(payload)
            // 这里的 `state` 对象是模块的局部状态,rootState 为根节点状态
            console.log(state)
            commit('increment', rootState.count + payload)

        }
    }
}

export default moduleB;

src/store/index.js

import Vue from 'vue'
import Vuex from 'vuex'
import moduleA from './modules/moduleA'
import moduleB from './modules/moduleB'

Vue.use(Vuex)

const store = new Vuex.Store({
    state: {
        count: 5
    },
    modules: {
        moduleA: moduleA,
        moduleB: moduleB,
    }
})

export default store;

组件中使用

<template>
  <div class="hello">
    <div>
      <h3>组件中使用 store</h3>
      <div>
        moduleA中的countA {{ countA }}
      </div>
      <div>
        moduleB中的countB {{ countB }}
      </div>
    </div>

    <div>
      <button v-on:click="clickCommit(1)">commit 加1</button>
      <button v-on:click="clickDispatch(1)">dispatch 加1</button>
    </div>
  </div>
</template>

<script>

export default {
  name: "CountView",

  methods: {
    clickCommit(val) {
      this.$store.commit("increment", val);
    },
    clickDispatch(val) {
      this.$store.dispatch("incrementIfOddOnRootSum", val);
    },
  },

  computed: {
    countA() {
      // moduleA 中的 countA
      return this.$store.state.moduleA.countA;
    },
    countB() {
      // moduleB 中的 countB
      return this.$store.state.moduleB.countB;
    },
  },
};
</script>

命名空间

  • 默认情况下,模块内部的 action、mutation 和 getter 是注册在全局命名空间的——这样使得多个模块能够对同一 mutation 或 action 作出响应
  • 可以通过添加 namespaced: true 的方式使其成为带命名空间的模块。
  • 当模块被注册后,它的所有 getter、action 及 mutation 都会自动根据模块注册的路径调整命名。

示例

store/modules/moduleA.js

const moduleA = {
    namespaced: true, // 设为命名空间
    
    state: {
        countA: 1
    },
    getters: {},
    mutations: {},
    actions: {}
}

export default moduleA;

store/modules/moduleB.js

const moduleB = {
    namespaced: true, // 设为命名空间
    
    state: {
        countB: 2
    },
    getters: {
        sumWithRootCount(state, getters, rootState) {
            // 这里的 state 和 getters 对象是模块的局部状态,rootState 为根节点状态
            console.log('B-state', state)
            console.log('B-getters', getters)
            console.log('B-rootState', rootState)
            return state.countB + rootState.count
        }

    },
    mutations: {
        increment(state, payload) {
            // 这里的 `state` 对象是模块的局部状态
            state.countB += payload;
        }
    },
    actions: {
        incrementIfOddOnRootSum({ state, commit, rootState }, payload) {
            console.log(payload)
            // 这里的 `state` 对象是模块的局部状态,rootState 为根节点状态
            console.log(state)
            commit('increment', rootState.count + payload)

        }
    }
}

export default moduleB;

src/store/index.js

import Vue from 'vue'
import Vuex from 'vuex'
import moduleA from './modules/moduleA'
import moduleB from './modules/moduleB'

Vue.use(Vuex)

const store = new Vuex.Store({
    state: {
        count: 5
    },
    modules: {
        moduleA: moduleA,
        moduleB: moduleB,
    }
})

export default store;

组件中使用

<template>
  <div class="hello">
    <div>
      <h3>组件中使用 store</h3>
      <div>moduleA中的countA {{ countA }}</div>
      <div>moduleB中的countB {{ countB }}</div>
    </div>

    <div>
      <button v-on:click="increment(1)">commit 加1</button>
      <button v-on:click="incrementIfOddOnRootSum(1)">dispatch 加1</button>
    </div>
  </div>
</template>

<script>
import { mapActions, mapMutations, mapState } from "vuex";

export default {
  name: "CountView",

  methods: {
    // 将模块的空间名称字符串作为第一个参数传递给 mapMutations
    ...mapMutations("moduleB", ["increment"]),

    // 将模块的空间名称字符串作为第一个参数传递给 mapActions
    ...mapActions("moduleB", ["incrementIfOddOnRootSum"]),
  },

  computed: {
    // 将模块的空间名称字符串作为第一个参数传递给 mapState
    ...mapState("moduleA", {
      countA: (state) => state.countA,
    }),
    ...mapState("moduleB", {
      countB: (state) => state.countB,
    }),
  },
};
</script>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/656314.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Unity实现首行缩进两个字符

效果 在Unity中如果想实现首行缩进两个字符&#xff0c;你会发现按空格是没法实现的。 实现原理&#xff1a;用空白的透明的字替代原来的位置。 代码&#xff1a; <color#FFFFFF00>XXX</color> 赶紧去试试吧&#xff01;

《架演》共创者第一次线上沟通会议总结

《架演》共创者第一次线上沟通——启动会 会议主题&#xff1a;《架演》共创启动会议会议时间&#xff1a;2024年5月28日&#xff0c;20:00 - 21:00会议地点&#xff1a;腾讯会议主持人&#xff1a;寒山参会人员&#xff1a; 夏军、mirror、刘哥、悟缺席人员&#xff1a;可心、…

性能测试(一)—— 性能测试理论+jmeter的使用

1.性能测试介绍 定义&#xff1a;软件的性能是软件的一种非功能特性&#xff0c;它关注的不是软件是否能够完成特定的功能&#xff0c;而是在完成该功能时展示出来的及时性。 由定义可知性能关注的是软件的非功能特性&#xff0c;所以一般来说性能测试介入的时机是在功能测试完…

20240521在Ubuntu20.04下编译RK3588平台的IPC方案

20240521在Ubuntu20.04下编译RK3588平台的IPC方案 2024/5/21 15:27 viewproviewpro-ThinkBook-16-G5-IRH:~$ viewproviewpro-ThinkBook-16-G5-IRH:~$ md5sum RK3588_IPC_SDK.tar.gz 7481cc8d59f697a5fa4fd655de866707 RK3588_IPC_SDK.tar.gz viewproviewpro-ThinkBook-16-G5…

【vue-4】遍历数组或对象v-for

1、遍历数组 <ul><li v-for"(value,index) in web.number">index>{{index}}:value>{{value}}</li> </ul> 知识点&#xff1a; <ul>标签定义无序列表 举例&#xff1a; <ul><li>Coffee</li><li>Tea…

LeetCode199二叉树的右视图

题目描述 给定一个二叉树的 根节点 root&#xff0c;想象自己站在它的右侧&#xff0c;按照从顶部到底部的顺序&#xff0c;返回从右侧所能看到的节点值。 解析 这一题的关键其实就是找到怎么去得到当前是哪一层级&#xff0c;可以利用队列对二叉树进行层次遍历&#xff0c;但…

FFmpeg操作命令 - 精简版

PS&#xff1a;&#xff08;因为我只需要简单的操作&#xff0c;所以我整理出了这份笔记&#xff09; 原网址&#xff1a;30分钟带你入门&#xff0c;20个 FFmpeg操作命令&#xff0c;包你学会 - 知乎 大佬零声Github整理库整理的笔记非常的全面&#xff0c;想看完整版去上面…

Java | Leetcode Java题解之第102题二叉树的层序遍历

题目&#xff1a; 题解&#xff1a; class Solution {public List<List<Integer>> levelOrder(TreeNode root) {Queue<TreeNode> queue new LinkedList<>();List<List<Integer>> res new ArrayList<>();if (root ! null) queue.a…

前端开发框架Angular

版权声明 本文原创作者&#xff1a;谷哥的小弟作者博客地址&#xff1a;http://blog.csdn.net/lfdfhl Angular概述 Angular是由Google开发并维护的一款开源前端开发框架。它最初被设计为用于构建单页面应用&#xff08;SPA&#xff09;&#xff0c;但随着版本的更新和发展&am…

torch.matmul()的用法

这篇文章记录torch.matmul()的用法 这里仿照官方文档中的例子说明&#xff0c;此处取整数随机数&#xff0c;用于直观的查看效果&#xff1a; vector x vector 两个一维向量的matmul相当于点积&#xff0c;得到一个标量 tensor1 torch.randint(1, 6, (3,)) tensor2 torch.…

LabVIEW通过以太网控制PLC程序开发

在使用LabVIEW通过以太网控制PLC程序开发时&#xff0c;需要综合考虑硬件、软件和通信协议的协调工作。以下是详细步骤、注意事项、重点和难点分析&#xff0c;以及几种实现方式及其特点的概述。 实现步骤 确定硬件和软件环境&#xff1a; 确定PLC型号和品牌&#xff08;如西门…

错误模块路径: ...\v4.0.30319\clr.dll,v4.0.30319 .NET 运行时中出现内部错误,进程终止,退出代码为 80131506。

全网唯一解决此BUG的文章&#xff01;&#xff01;&#xff01; 你是否碰到了以下几种问题&#xff1f;先说原因解决思路具体操作1、首先将你C:\Windows\Microsoft.NET\文件夹的所有者修改为你当前用户&#xff0c;我的是administrator。2、修改当前用户权限。3、重启电脑4、删…

你什么时候感觉学明白Java了?

学是学不明白Java的&#xff0c;要学明白Java&#xff0c;一定只能在工作以后。 1 在学习阶段&#xff0c;哪怕是借鉴别人的学习路线&#xff0c;其实依然会学很多不必要的技能&#xff0c;比如jsp&#xff0c;swing&#xff0c;或者多线程&#xff0c;或者设计模式。 2 或者…

业内宝刊!影响因子3连涨,OA可选,Elsevier旗下这本SSCI解救你的选刊纠结症

【SciencePub学术】今天小编给大家带来了一本经济类的高分优刊解读&#xff0c;隶属于Elsevier出版社&#xff0c;JCR1区&#xff0c;中科院2区&#xff0c;影响因子高达4.8&#xff0c;且实时影响因子还在持续上涨中&#xff0c;领域相符的学者可着重考虑&#xff01; Emergin…

微服务架构五大设计模式详解,助你领跑行业

微服务架构设计模式详解(5种主流模式) 微服务架构 微服务&#xff0c;一种革命性的架构模式&#xff0c;主张将大型应用分解为若干小服务&#xff0c;通过轻量级通信机制互联。每个服务专注特定业务&#xff0c;具备独立部署能力&#xff0c;轻松融入生产环境&#xff0c;为系…

你对仲裁裁决不服怎么办?我教你四个狠招!

你对仲裁裁决不服怎么办&#xff1f;我教你四个狠招&#xff01; 这个标题是什么意思呢&#xff1f;也就是说&#xff0c;当你&#xff08;或用人单位&#xff09;向劳动仲裁委提出仲裁申请后&#xff0c;但劳动仲裁结果没有维护你的权益&#xff0c;或者你不满意&#xff0c;…

js 面试题学习笔记一

1、什么是防抖和节流&#xff1f;有什么区别&#xff1f;如何实现&#xff1f; 防抖&#xff1a;触发高频事件后N秒内函数只会执行一次&#xff0c;如果N秒高频事件再次被触发&#xff0c;则重新计算时间。&#xff08;a时间触发&#xff0c;5秒内执行一次&#xff0c;但是第4…

探索Solana链上DApp开发:高性能区块链生态的新机遇

Solana 是一个新兴的区块链平台&#xff0c;致力于为 DApp&#xff08;去中心化应用程序&#xff09;开发者提供高性能、低成本的解决方案。Solana 的独特之处在于其创新性的共识机制和高吞吐量的网络&#xff0c;使得开发者可以构建高度可扩展的 DApp&#xff0c;并为用户提供…

企业营收分析难?搞定收入认领月底不加班!

在当今日益激烈的市场竞争中&#xff0c;企业的营收分析不仅是衡量经营成果的关键指标&#xff0c;更是指导企业未来发展的重要依据。然而&#xff0c;对于许多企业来说&#xff0c;营收分析的过程往往繁琐且耗时&#xff0c;尤其是月底结账时&#xff0c;大量的数据和复杂的计…

鸿蒙OS开发:典型页面场景【一次开发,多端部署】(信息应用)案例

信息应用 简介 内容介绍 Mms应用是OpenHarmony中预置的系统应用&#xff0c;主要的功能包含信息查看、发送短信、接收短信、短信送达报告、删除短信等功能。 架构图 目录 /Mms/ ├── doc # 资料 ├── entry │ └── src │…