<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                [TOC] #### 仿餓了么購物車跳動動畫 ![](https://box.kancloud.cn/bf611640c99eeafe18dfd4471cf47ebe_377x450.png) * [ ] 實現思路 1. 點擊添加購物按鈕,發布事件給父組件 2. 父組件監聽事件,改變全局變量,延遲500ms后在還原變量 * [ ] 實現代碼 1. vuex 中添加全局變量,控制動畫顯示 / 隱藏 ~~~ export default { state: { showCart: false // 控制動畫樣式顯示 || 隱藏 }, ~~~ ***** 2. 綁定動畫樣式 ![](https://box.kancloud.cn/41c5eb9b260467c1d1cce30ec1eb5fee_386x65.png) ~~~ <div class="left-cart" :class="{animationShake: showCart}"> <div class="cart-icon" :class="{highlight: totalPrice > 0}"> <i class="icon-shopping_cart"></i> <span class="icon-count" v-show="totalCount">{{totalCount}}</span> </div> </div> ~~~ ~~~ .left-cart flex 0 0 54px width 54px height 54px margin -10px 16px 0 16px z-index 9999 border-radius 50% background-color: #131d26; display flex align-items center justify-content center &.animationShake animation:bottomNav-shake .5s ease-in-out @keyframes bottomNav-shake 0% transform scale(1) 25% transform scale(.8) 50% transform scale(1.1) 75% transform scale(0.9) to transform scale(1) ~~~ ***** 3. 監聽添加購物按鈕,發布事件 ![](https://box.kancloud.cn/aae67daf98a887232af51056637ee890_295x175.png) ~~~ <div class="plus" @click.stop="plus"> <span class="icon-add_circle"></span> </div> ~~~ ~~~ methods: { plus() { if (!this.foods.count) { this.$set(this.foods, 'count', 1) } else { this.foods.count++ } this.$emit('add') }, ~~~ ***** 4.父組件監聽事件,執行邏輯 ~~~ <!-- 購物組件 --> <cart-control :foods="food" @add="onAddHandle"/> ~~~ ~~~ methods: { onAddHandle() { this.setShowCart(true).then(() => { setTimeout(() => { // 調用子組件方法,隱藏樣式 this.$refs.shopCart.hide() },500) }) } }, ~~~
                  <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>

                              哎呀哎呀视频在线观看