Hỏi về vue js

  • Mọi người cho e hỏi đoạn này với.
    Actions are similar to mutations, the difference being that:
    Instead of mutating the state, actions commit mutations.
    Actions can contain arbitrary asynchronous operations.

    Action handlers receive a context object which exposes the same set of methods/properties on the store instance, so you can call context.commit to commit a mutation, or access the state and getters via context.state and context.getters. We will see why this context object is not the store instance itself when we introduce Modules later.
    In practice, we often use ES2015 argument destructuring to simplify the code a bit (especially when we need to call commit multiple times):
    Em google dịch mà không hiểu nên đăng nên hỏi anh chị e nào biết nó chỉ e với ạ

Log in to reply