<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                登陸成功之后我們將用戶信息需要返回給前端,這個時候在vue當中我們就可以使用vuex來保存全局變量 ![](https://img.kancloud.cn/5e/f1/5ef1b560a4bf29ba1cbfb673b8a27945_1056x997.png) 然后我們再來看如何去使用 來到login.vue登陸組件當中 當登陸成功之后 ![](https://img.kancloud.cn/fe/04/fe0479289affb3c72e0466d217192730_1878x1029.png) ### 其中@符號表示的是web根路徑也就是src目錄下 當我們加載 ~~~ import store from "@/store" ~~~ 的時候就會自動去找里面的index.js去加載 當然你也可以寫成 ~~~ import store from "@/store/index"; ~~~ 也是可以的 ### 上面演示了如何設置store全局變量 ### 接下來我們看如何獲取store全局變量來使用它 ### ![](https://img.kancloud.cn/cc/cd/cccd62e75ad3cbb1cefbf1df878b7ef6_1890x1003.png) ### 但是這樣有個問題 因為我們只是設置了web模塊的全局變量store當中的member一旦刷新頁面前端登陸的用戶名稱就會丟失 所以我們還得繼續完善
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看