<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      vue封裝全局確認彈窗

      下載文件1、彈窗組件

      <template>
          <view class="bombFrame" v-if="bshow" :class="show?'show':'hide'">
              <view class="telate" :class="show?'bshow':'bhide'">
                  <view class="hint">
                      <view>{{title}}</view>
                      <view @touchstart.prevent="noClick">
                          <image src="./static/cha.svg" mode="" />
                      </view>
                  </view>
                  <view class="promptContent">
                      <view>
                          <image src="./static/gantan.svg" mode="" />
                      </view>
                      <view>{{content}}</view>
                  </view>
                  <view class="operate">
                      <view @touchstart.prevent="noClick">{{noBtnText}}</view>
                      <view @touchstart.prevent="yesClick">{{yesBtnText}}</view>
                  </view>
              </view>
          </view>
      </template>
      <script>
      /**
       *
       *
       *   this.$Message({ content: "模式未保存,確定離開?" })
                  .then(() => {
                      console.log("yes");
                  })
                  .catch(() => {
                      console.log("cancel");
                  });
       *
       *
       */
      export default {
          props: {
              title: {
                  type: String,
                  default: "提示",
              },
              yesBtnText: {
                  type: String,
                  default: "確定",
              },
              noBtnText: {
                  type: String,
                  default: "取消",
              },
              hasMark: {
                  type: Boolean,
                  default: true,
              },
              content: {
                  type: String,
                  default: "此操作將永久刪除該文件, 是否繼續?",
              },
          },
          data() {
              return {
                  promiseStatus: null,
                  show: false,
                  bshow: false,
              };
          },
          methods: {
              messag() {
                  let _this = this;
                  this.show = true;
                  this.bshow = true;
                  return new Promise(function (resolve, reject) {
                      _this.promiseStatus = { resolve, reject };
                  });
              },
              noClick() {
                  this.show = false;
                  setTimeout(() => {
                      this.bshow = false;
                  }, 500);
                  this.promiseStatus && this.promiseStatus.reject();
              },
              yesClick() {
                  this.show = false;
                  setTimeout(() => {
                      this.bshow = false;
                  }, 500);
                  this.promiseStatus && this.promiseStatus.resolve();
              },
              alertClick() {
                  this.show = false;
                  setTimeout(() => {
                      this.bshow = false;
                  }, 500);
                  this.promiseStatus && this.promiseStatus.resolve();
              },
          },
      };
      </script>
      <style lang='scss'>
      @keyframes move {
          0% {
              background: rgba(0, 0, 0, 0.5);
              opacity: 1;
          }
          50% {
              background: rgba(0, 0, 0, 0.2);
          }
          100% {
              background: rgba(0, 0, 0, 0);
              opacity: 0;
          }
      }
      @keyframes move2 {
          0% {
              background: rgba(0, 0, 0, 0);
              opacity: 0;
          }
          50% {
              background: rgba(0, 0, 0, 0.2);
          }
          100% {
              background: rgba(0, 0, 0, 0.5);
              opacity: 1;
          }
      }
      @keyframes move4 {
          0% {
              background: rgba(255, 255, 255, 1);
              transform: translateY(0);
          }
          50% {
              background: rgba(255, 255, 255, 0.5);
          }
          100% {
              background: rgba(255, 255, 255, 0);
              transform: translateY(-50rpx);
              display: none !important;
          }
      }
      @keyframes move3 {
          0% {
              background: rgba(255, 255, 255, 1);
              transform: translateY(-50rpx);
          }
          100% {
              background: rgba(255, 255, 255, 1);
              transform: translateY(0);
          }
      }
      .show {
          -webkit-transition: -webkit-transform 1s;
          transition: transform 1s;
          animation: move2 0.5s; /*自定義動畫名稱*/
          animation-fill-mode: forwards; /*動畫執行完后的狀態*/
      }
      .hide {
          -webkit-transition: -webkit-transform 1s;
          transition: transform 1s;
          animation: move 0.5s; /*自定義動畫名稱*/
          animation-fill-mode: forwards; /*動畫執行完后的狀態*/
      }
      .bshow {
          -webkit-transition: -webkit-transform 1s;
          transition: transform 1s;
          animation: move3 0.5s; /*自定義動畫名稱*/
          animation-fill-mode: forwards;
      }
      .bhide {
          -webkit-transition: -webkit-transform 1s;
          transition: transform 1s;
          animation: move1 0.5s; /*自定義動畫名稱*/
          animation-fill-mode: forwards; /*動畫執行完后的狀態*/
      }
      .bombFrame {
          position: fixed;
          z-index: 9900;
          width: 100vw;
          height: 100vh;
          top: 0;
          left: 0;
          background: rgba(0, 0, 0, 0.5);
          display: flex;
          justify-content: center;
          align-items: center;
          box-shadow: 0px 2px 9px 3px rgba(0, 0, 0, 0.5);
          .telate {
              background-color: #fff;
              border-radius: 20rpx;
              width: 700rpx;
              padding: 30rpx;
              box-sizing: border-box;
              .hint {
                  display: flex;
                  align-items: center;
                  justify-content: space-between;
                  > view:nth-child(1) {
                      color: #303133;
                      font-size: 32rpx;
                  }
                  > view:nth-child(2) {
                      width: 50rpx;
                      height: 50rpx;
                      image {
                          width: 100%;
                          height: 100%;
                      }
                  }
              }
              .promptContent {
                  display: flex;
                  align-items: center;
                  margin-top: 30rpx;
                  > view:nth-child(1) {
                      width: 50rpx;
                      height: 50rpx;
                      image {
                          width: 100%;
                          height: 100%;
                      }
                  }
                  > view:nth-child(2) {
                      color: #606266;
                      font-size: 28rpx;
                      margin-left: 25rpx;
                  }
              }
              .operate {
                  display: flex;
                  justify-content: end;
                  margin-top: 30rpx;
                  > view:nth-child(1) {
                      padding: 15rpx 30rpx;
                      font-size: 24rpx;
                      border-radius: 6rpx;
                      background: #fff;
                      border: 1px solid #dcdfe6;
                      color: #606266;
                  }
                  > view:nth-child(2) {
                      padding: 15rpx 30rpx;
                      font-size: 24rpx;
                      margin-left: 20rpx;
                      border-radius: 6rpx;
                      background: #009788;
                      border: 1px solid #dcdfe6;
                      color: #ffffff;
                  }
              }
          }
      }
      </style>

      2、往vue中掛載組件 (創建js)

      import Vue from 'vue'
      import messag from './index.vue'
      const VueComponent = Vue.extend(messag);
      const vm = new VueComponent().$mount();
      let init = false;
      let defaultOptions = {
          yesBtnText: '確定',
          noBtnText: '取消'
      };
      
      const message = function (options) {
          Object.assign(vm, defaultOptions, options, {
              type: 'confirm'
          });
          if (!init) {
              document.body.appendChild(vm.$el);
              init = true;
          }
          return vm.messag();
      };
      
      export default message;

      3、應用全局組件
      3.1 在main.js中引入全局

      import Message from '@/components/message/index'
      Vue.prototype.$Message = Message;
       
      3.2 頁面中使用組件
      this.$Message({ content: "模式未保存,確定離開?" })
      .then(() => {
          console.log("yes");
      }).catch(() => {
          console.log("cancel");
      });

       

      posted @ 2022-09-08 16:18  雨落風  閱讀(598)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 西西人体www大胆高清| 久久人妻无码一区二区三区av | 人妻无码ΑV中文字幕久久琪琪布| av综合亚洲一区二区| 久久激情影院| 丰满熟妇乱又伦在线无码视频| 国产亚洲精品AA片在线爽 | 欧美牲交videossexeso欧美| 日韩精品中文字幕国产一| 日本阿v片在线播放免费| 国产在线线精品宅男网址| 久久综合狠狠综合久久| 国产精一品亚洲二区在线播放| 国产二区三区不卡免费| 亚洲日韩中文字幕在线播放| 人妻中出无码一区二区三区| 午夜福利一区二区在线看| 人妻系列中文字幕精品| 69人妻精品中文字幕| 四虎国产精品永久在线国在线| 国产福利精品一区二区| 熟妇人妻不卡中文字幕| 欧美人与性囗牲恔配| 国产二区三区不卡免费| 欧美人成精品网站播放| 国产高清av首播原创麻豆| 国产亚洲精品一区二区不卡| 中文国产不卡一区二区| 国产精品一区二区人人爽| 精品熟女日韩中文十区| 日韩有码中文在线观看| 国产精品亚洲欧美大片在线看| 一区二区三区精品偷拍| 她也色tayese在线视频| 一本精品99久久精品77| 亚洲精品韩国一区二区| 亚洲国产成人精品无色码| 国产成人综合久久精品下载| 国产精品美女久久久久久麻豆 | 强奷乱码欧妇女中文字幕熟女| 国产高跟黑色丝袜在线|