国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Vue3使用element-plus實(shí)現(xiàn)彈窗效果-demo

這篇具有很好參考價(jià)值的文章主要介紹了Vue3使用element-plus實(shí)現(xiàn)彈窗效果-demo。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

Vue3使用element-plus實(shí)現(xiàn)彈窗效果-demo,Vue,vue.js,javascript,elementui

?使用?


<ShareDialog v-model="isShow" @onChangeDialog="onChangeDialog" />
import ShareDialog from './ShareDialog.vue';
const isShow = ref(false);
const onShowDialog = (show) => {
  isShow.value = show;
};
const onChangeDialog = (val) => {
  console.log('onSureClick', val);
  isShow.value = false;
};

?組件代碼

<template>
  <el-dialog
    v-model="isShow"
    :show-close="false"
    class="share-dialog-dialog"
    style="
      width: 423px;
      height: 314px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      background-color: #fff !important;
    "
  >
    <template #header>
      <div class="dialog-header">
        <div class="title">帶單平臺(tái)設(shè)置</div>
        <img
          src="@/assets/images/followOrder/close.svg"
          @click="isShow = false"
        />
      </div>
    </template>
    <template #default>
      <div class="dialog-box">
        <div
          :class="['icon', { active: Bi.includes('okx') }]"
          @click="selectBi('okx')"
        >
          <i class="icon-btn"></i>
          <img class="icon-bi" src="@/assets/images/followOrder/okx-icon.svg" />
          <span>Okx</span>
        </div>
        <div
          :class="['icon', { active: Bi.includes('binance') }]"
          @click="selectBi('binance')"
        >
          <i class="icon-btn"></i>
          <img
            class="icon-bi"
            src="@/assets/images/followOrder/binance-icon.svg"
          />
          <span>Binance</span>
        </div>
        <div
          :class="['icon', { active: Bi.includes('bitget') }]"
          @click="selectBi('bitget')"
        >
          <i class="icon-btn"></i>
          <img
            class="icon-bi"
            src="@/assets/images/followOrder/bitget-icon.svg"
          />
          <span>Bitget</span>
        </div>
      </div>
    </template>
    <template #footer>
      <div class="dialog-footer">
        <div class="false" @click="isShow = false">取消</div>
        <div class="true" @click="onSureClick">確定</div>
      </div>
    </template>
  </el-dialog>
</template>

<script setup>
import { defineProps, defineEmits, ref, reactive } from 'vue';
const props = defineProps({
  modelValue: {
    type: Boolean,
    default: false
  }
});

const Bi = reactive([]);
const selectBi = (val) => {
  console.log(val, 888);
  const i = Bi.indexOf(val);
  if (i <= -1) {
    Bi.push(val);
  } else {
    Bi.splice(i, 1);
  }
  console.log(Bi, 88);
};
const emits = defineEmits(['update:modelValue', 'onChangeDialog']);
const isShow = computed({
  get() {
    return props.modelValue;
  },
  set(val) {
    emits('update:modelValue', val);
  }
});

const onSureClick = (val) => {
  emits('onChangeDialog', true);
};
</script>

<style lang="less">
.el-dialog__header {
  margin-right: 0;
}
</style>
<style lang="less" scoped>
.share-dialog-dialog {
  .dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f1f1;
    padding-bottom: 14px;
    .title {
      color: #000;
      font-size: 20px;
      font-style: normal;
      font-weight: 600;
      line-height: normal;
    }
    img {
      width: 14.161px;
      height: 14.515px;
      cursor: pointer;
    }
  }

  .dialog-box {
    padding: 0 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .icon {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 110px;
      height: 110px;
      border-radius: 4px;
      border: 1px solid #f1f1f1;
      background: #fff;
      .icon-btn {
        position: absolute;
        top: 5px;
        right: 5px;
        width: 15px;
        height: 15px;
        background-image: url(@/assets/images/followOrder/quan-icon.svg);
        background-size: contain;
        background-repeat: no-repeat;
      }
      .icon-bi {
        width: 40px;
        height: 40px;
        margin-bottom: 8px;
      }
      & > span {
        color: #000;
        font-size: 16px;
        font-family: PingFang SC;
        font-style: normal;
        font-weight: 500;
        line-height: normal;
      }
    }
    .active {
      border: 1px solid #31daff;
      background: #f1fdff;
      .icon-btn {
        background-image: url(@/assets/images/followOrder/gou-icon.svg);
      }
    }
  }
  .dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #000;
    .false {
      padding: 10px 75px;
      border: 1px solid #000000;
      border-radius: 4px;
      cursor: pointer;
    }
    .true {
      padding: 10px 75px;
      background: #31daff;
      // background: linear-gradient(266.54deg, #f1fb6f 0%, #7cf9cd 98.94%);
      border-radius: 4px;
      cursor: pointer;
    }
  }
}
</style>

基礎(chǔ)代碼?

<template>
  <ElDialog
    :append-to-body="true"
    destroy-on-close
    :show-close="false"
    v-model="isShow"
    class="application-dialog"
  >
    <div class="application-dialog-container">
      <h1>111111</h1>
    </div>
  </ElDialog>
</template>

<script setup>
import { ElDialog, ElButton } from 'element-plus';
import { defineProps, defineEmits, ref, reactive } from 'vue';

const props = defineProps({
  modelValue: {
    type: Boolean,
    default: false
  }
});

const emits = defineEmits(['update:modelValue', 'onChangeDialog']);
const isShow = computed({
  get() {
    return props.modelValue;
  },
  set(val) {
    emits('update:modelValue', val);
  }
});

const onSureClick = (val) => {
  emits('onChangeDialog', true);
};
</script>

<style lang="less" scoped></style>

Vue3使用element-plus實(shí)現(xiàn)彈窗效果-demo,Vue,vue.js,javascript,elementui文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-549433.html

?完整代碼?

<template>
  <ElDialog
    destroy-on-close
    :show-close="false"
    :append-to-body="true"
    v-model="isShow"
    class="application-dialog"
    style="width: 420px; height: 266px"
  >
    <div class="application-dialog-container">
      <img class="fail" src="@/assets/images/followOrder/fail-1.svg" />
      <div class="title">{{ errType.title }}</div>
      <div class="cont">
        {{ errType.cont }}
      </div>
      <div class="footer">
        <div class="but" @click="closeDialog">確定</div>
      </div>
    </div>
  </ElDialog>
</template>

<script setup>
import { ElDialog, ElButton } from 'element-plus';
import { defineProps, defineEmits, ref, reactive } from 'vue';

const props = defineProps({
  modelValue: {
    type: Boolean,
    default: false
  },
  errType: {
    type: Object,
    default: {
      title: '審核中',
      cont: '申請(qǐng)?zhí)峤怀晒Γ覀兊墓ぷ魅藛T將在24小時(shí)內(nèi)完成審核'
    }
  }
});

const emits = defineEmits(['update:modelValue', 'onChangeDialog']);
const isShow = computed({
  get() {
    return props.modelValue;
  },
  set(val) {
    emits('update:modelValue', val);
  }
});

const closeDialog = (val) => {
  console.log('onChangeDialog');
  emits('onChangeDialog', true);
};
</script>
<style lang="less">
//單獨(dú)設(shè)置顏色 /deep/ :deep  ::v-deep
.application-dialog {
  &.el-dialog {
    --el-dialog-bg-color: transparent !important;
    .el-dialog__header,
    .el-dialog__body {
      padding: 0;
    }
  }
}
</style>
<style lang="less" scoped>
.application-dialog {
  position: relative;
  .application-dialog-container {
    position: absolute;
    width: 100%;
    height: 246px;
    background: #ffffff;
    border-radius: 8px;
    bottom: 0;
    padding: 70px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    .title {
      color: #000;
      text-align: center;
      font-size: 18px;
      font-family: PingFang SC;
      font-style: normal;
      font-weight: 500;
      line-height: normal;
    }
    .cont {
      display: flex;
      flex-direction: column;
      color: #868e9b;
      text-align: center;
      font-size: 14px;
      font-family: PingFang SC;
      font-style: normal;
      font-weight: 500;
      line-height: normal;
      padding: 0 14px;
    }
    .footer {
      .but {
        width: 372px;
        height: 40px;
        color: #fff;
        font-size: 14px;
        font-family: PingFang SC;
        font-style: normal;
        font-weight: 500;
        line-height: normal;
        background: #000;
        border-radius: 5px;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
      }
    }
    .fail {
      width: 64.632px;
      height: 66.607px;
      position: absolute;
      top: -20px;
      left: calc((100% / 2) - (64.632px / 2));
    }
  }
}
</style>

彈窗-over?

<template>
  <el-dialog
    v-model="isShow"
    :show-close="false"
    class="share-dialog-dialog"
    style="
      width: 319px;
      height: 209px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      background-color: #fff !important;
    "
  >
    <template #default>
      <div class="dialog-text">確定以當(dāng)前市場(chǎng)價(jià)格平倉(cāng)?</div>
    </template>
    <template #footer>
      <div class="dialog-footer">
        <div class="false" @click="isShow = false">取消</div>
        <div class="true" @click="onSureClick()">確定</div>
      </div>
    </template>
  </el-dialog>
</template>

<script setup>
import { defineProps, defineEmits, ref, reactive } from 'vue';
const props = defineProps({
  modelValue: {
    type: Boolean,
    default: false
  }
});

const Bi = reactive([]);
const selectBi = (val) => {
  console.log(val, 888);
  const i = Bi.indexOf(val);
  if (i <= -1) {
    Bi.push(val);
  } else {
    Bi.splice(i, 1);
  }
  console.log(Bi, 88);
};
const emits = defineEmits(['update:modelValue', 'onChangeDialog']);
const isShow = computed({
  get() {
    return props.modelValue;
  },
  set(val) {
    emits('update:modelValue', val);
  }
});

const onSureClick = (val) => {
  emits('onChangeDialog', true);
};
</script>

<style lang="less">
.el-dialog__header {
  margin-right: 0;
}
</style>
<style lang="less" scoped>
.share-dialog-dialog {
  .dialog-text {
    font-family: 'PingFang SC';
    font-size: 18px;
    line-height: 25px;
    text-align: center;
    padding: 20px 0;
    color: #000000;
  }
  .dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #000;
    .false {
      padding: 10px 50px;
      border: 1px solid #000000;
      border-radius: 4px;
      cursor: pointer;
    }
    .true {
      padding: 10px 50px;
      background: #000;
      color: #fff;
      // background: linear-gradient(266.54deg, #f1fb6f 0%, #7cf9cd 98.94%);
      border-radius: 4px;
      cursor: pointer;
    }
  }
}
</style>

<!-- 使用
  <ClosingDialog v-model="isShow" @onChangeDialog="onChangeDialog" />
  import ClosingDialog from '@/views/followOrder/myTracking/components/ClosingDialog.vue';
  const isShow = ref(false);
  const onShowDialog = (show) => {
    isShow.value = show;
  };
  const onChangeDialog = (val) => {
    console.log('onSureClick', val);
    isShow.value = false;
  }; -->

到了這里,關(guān)于Vue3使用element-plus實(shí)現(xiàn)彈窗效果-demo的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • (二) Vue3 + Element-Plus 實(shí)現(xiàn)動(dòng)態(tài)菜單欄

    (二) Vue3 + Element-Plus 實(shí)現(xiàn)動(dòng)態(tài)菜單欄

    系列介紹:Vue3 + Vite + TS 從零開(kāi)始學(xué)習(xí) 項(xiàng)目搭建:(一) Vue3 + Vite + TS 項(xiàng)目搭建 實(shí)現(xiàn)動(dòng)態(tài)菜單欄:(二) Vue3 + Element-Plus 實(shí)現(xiàn)動(dòng)態(tài)菜單欄 實(shí)現(xiàn)動(dòng)態(tài)面包屑:(三) Vue3 + Element-Plus 實(shí)現(xiàn)動(dòng)態(tài)面包屑 實(shí)現(xiàn)動(dòng)態(tài)標(biāo)簽頁(yè):(四) Vue3 + Element-Plus 實(shí)現(xiàn)動(dòng)態(tài)標(biāo)簽頁(yè) 實(shí)現(xiàn)動(dòng)態(tài)主題色切換(demo):(五)

    2023年04月23日
    瀏覽(59)
  • vue3 - element-plus 上傳各種 word pdf 文件、圖片視頻并上傳到服務(wù)器功能效果,示例代碼開(kāi)箱即用。

    vue3 - element-plus 上傳各種 word pdf 文件、圖片視頻并上傳到服務(wù)器功能效果,示例代碼開(kāi)箱即用。

    在 vue3 項(xiàng)目中,使用 element plus 組件庫(kù)的 el-upload 上傳組件,進(jìn)行文件、圖片圖像的上傳功能示例。 可直接復(fù)制,再改個(gè)接口地址。 在這里上傳

    2024年02月15日
    瀏覽(53)
  • Vue3 element-plus表單嵌套表格實(shí)現(xiàn)動(dòng)態(tài)表單驗(yàn)證

    Vue3 element-plus表單嵌套表格實(shí)現(xiàn)動(dòng)態(tài)表單驗(yàn)證

    部分效果圖如下: 另表格有添加和刪除按鈕,點(diǎn)擊提交進(jìn)行表單驗(yàn)證。 首先data格式必須是對(duì)象包裹數(shù)組 給表單綁定form數(shù)據(jù) 表格綁定tableData數(shù)據(jù) 給表單項(xiàng)增加驗(yàn)證規(guī)則 rules對(duì)應(yīng)data rules對(duì)象,prop對(duì)應(yīng)表單字段(注意是表格里每一行對(duì)應(yīng)的字段 forms.tableData[下標(biāo)].key) prop的關(guān)

    2024年02月14日
    瀏覽(25)
  • 在Vue3中使用Element-Plus分頁(yè)(Pagination )組件

    在Vue3中使用Element-Plus分頁(yè)(Pagination )組件

    開(kāi)發(fā)過(guò)程中數(shù)據(jù)展示會(huì)經(jīng)常使用到,同時(shí)分頁(yè)功能也會(huì)添加到頁(yè)面中。 記: 在Vue3中使用Element-Plus分頁(yè)組件與表格數(shù)據(jù)實(shí)現(xiàn)分頁(yè)交互。 引入表格和分頁(yè)組件的H5標(biāo)簽。 js代碼,先初始化變量。 沒(méi)用到后臺(tái),所以就把表格的數(shù)據(jù)寫(xiě)固定了。下面就表格數(shù)據(jù)生成,還有模擬對(duì)數(shù)據(jù)

    2024年02月05日
    瀏覽(29)
  • 記錄--vue3優(yōu)雅的使用element-plus的dialog

    記錄--vue3優(yōu)雅的使用element-plus的dialog

    擺脫繁瑣的 visible 的命名,以及反復(fù)的重復(fù) dom。 將 dialog 封裝成一個(gè)函數(shù)就能喚起的組件。如下: ? 首先定義了 dialogList,它包含了所有彈窗的信息。 component 使用 componet is 去動(dòng)態(tài)加載子組件 addDialog 調(diào)用喚起彈窗的函數(shù) closeDialog 關(guān)閉彈窗的函數(shù) 創(chuàng)建一個(gè)彈窗組件 在列表頁(yè)面

    2024年02月05日
    瀏覽(26)
  • 使用 Vite + Vue3 + Element-Plus + Pinia + Ts 搭建 Vue3 項(xiàng)目

    使用 Vite + Vue3 + Element-Plus + Pinia + Ts 搭建 Vue3 項(xiàng)目

    Vite 需要 Node.js 版本 14.18+,16+。然而,有些模板需要依賴更高的 Node 版本才能正常運(yùn)行,當(dāng)你的包管理器發(fā)出警告時(shí),請(qǐng)注意升級(jí)你的 Node 版本。 首先 npm 輸入: Project name :項(xiàng)目名稱 Select a framework :選擇一個(gè)框架 Select a variant :選擇 ts 或者 js 輸入項(xiàng)目名稱后選擇 vue 選擇

    2024年02月09日
    瀏覽(27)
  • vue3.x結(jié)合element-plus如何使用icon圖標(biāo)

    vue3.x結(jié)合element-plus如何使用icon圖標(biāo)

    ?基于 Vue 3的Element Plus如何使用icon圖標(biāo) 首先注意Element Plus版本:官網(wǎng)如圖所示, ?基于vue3的具體如何使用: 參考官網(wǎng)文檔: 1.首先選擇一種方式安裝 ?2.然后全局注冊(cè)圖標(biāo) 在main.js或main.ts文件中引入: ?3.然后就可以使用了,具體實(shí)例如下: 使用方式1:輸入框中使用 輸入框

    2023年04月08日
    瀏覽(22)
  • Vue3中動(dòng)態(tài)綁定:disabled element-plus使用方法

    @change=\\\"whetherFlag($event)\\\"? 根據(jù)value值判斷是否禁用?:disabled=\\\"isShow\\\" 初始值為禁用狀態(tài) const isShow = refboolean(true); ?根據(jù)value的值判斷是否禁用 ?

    2024年01月25日
    瀏覽(30)
  • 解決Vue3 使用Element-Plus導(dǎo)航刷新active高亮消失

    解決Vue3 使用Element-Plus導(dǎo)航刷新active高亮消失

    啟用路由模式會(huì)在激活導(dǎo)航時(shí)以 index 作為 path 進(jìn)行路由跳轉(zhuǎn) 使用 default-active 來(lái)設(shè)置加載時(shí)的激活項(xiàng)。 接下來(lái)打印一下選中項(xiàng)index和index路徑, 刷新也是沒(méi)有任何問(wèn)題的,active不會(huì)消失,整體代碼如下:

    2024年02月14日
    瀏覽(20)
  • vue3+element-plus+el-image實(shí)現(xiàn)點(diǎn)擊按鈕預(yù)覽大圖

    需求:點(diǎn)擊某個(gè)按鈕實(shí)現(xiàn)el-image中預(yù)覽大圖的效果 官方文檔:以下是官方的寫(xiě)法,并不能達(dá)到我們的要求,官方實(shí)現(xiàn)的功能是點(diǎn)擊圖片達(dá)到預(yù)覽大圖的效果。如果你的按鈕就是圖片,也可以達(dá)到目前的功能 el-image-viewer組件是element官方的組件,只是文檔中沒(méi)有寫(xiě)出來(lái),這個(gè)組

    2024年02月12日
    瀏覽(33)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包