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

Vue中使用element-plus中的el-dialog定義彈窗-內(nèi)部樣式修改-v-model實(shí)現(xiàn)-demo

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

效果圖

Vue中使用element-plus中的el-dialog定義彈窗-內(nèi)部樣式修改-v-model實(shí)現(xiàn)-demo,Vue,JavaScript,vue.js,javascript,前端,原力計(jì)劃

?實(shí)現(xiàn)代碼

<template>
  <el-dialog class="no-code-dialog" v-model="isShow" title="沒(méi)有收到驗(yàn)證碼?">
    <div class="nocode-body">
      <div class="tips">請(qǐng)嘗試一下操作</div>
      <div class="wrap">
        <div class="row"><i></i><span>請(qǐng)確認(rèn)郵箱地址是否輸入正確。</span></div>
        <div class="row">
          <i></i><span>郵件發(fā)送可能存在延遲,請(qǐng)稍等片刻。</span>
        </div>
        <div class="row"><i></i><span>請(qǐng)確認(rèn)郵件是否在垃圾箱中。</span></div>
        <div class="row">
          <i></i><span>若問(wèn)題仍未解決,請(qǐng)聯(lián)系客服尋求幫助 。</span>
        </div>
      </div>
    </div>
    <template #footer>
      <div class="dialog-btn" @click="isShow = false">確定</div>
    </template>
  </el-dialog>
</template>

<script setup>
import { ref, computed, defineProps, defineEmits } from 'vue';
const props = defineProps({
  modelValue: {
    type: Boolean,
    default: false
  }
});
const emits = defineEmits(['update:modelValue']);
const isShow = computed({
  set(val) {
    emits('update:modelValue', val);
  },
  get() {
    return props.modelValue;
  }
});
</script>

樣式修改

<style lang="less" scoped>
.no-code-dialog {
  .nocode-body {
    .tips {
      color: #6c6c6c;
      font-family: PingFang SC;
      font-size: 14px;
      font-weight: 600;
      padding: 30px 0 15px;
    }
    .wrap {
      .row {
        display: flex;
        align-items: center;
        margin-bottom: 10px;
        i {
          display: inline-block;
          width: 7px;
          height: 7px;
          transform: rotate(45deg);
          background-color: #000;
        }
        span {
          color: #000;
          font-family: PingFang SC;
          font-size: 14px;
          margin-left: 10px;
        }
      }
    }
  }
  .dialog-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 372px;
    height: 40px;
    border-radius: 4px;
    background: #000;
    color: #fff;
    font-family: PingFang SC;
    font-size: 14px;
    font-weight: 500;
  }
}
// :deep(.el-dialog) {
//   background: #fff;
// }
// :deep(.el-dialog__body) {
//   height: 350px;
//   padding-bottom: 0px;
// }
</style>
<style lang="less">
.el-overlay {
  .el-overlay-dialog {
    .el-dialog.no-code-dialog {
      --el-dialog-width: 420px;
      --el-dialog-bg-color: #fff;
      .el-dialog__header .el-dialog__title {
        color: #000;
      }
    }
  }
}
</style>

.el-dialog.no-code-dialog 添加自己定義的類名用于區(qū)分其他組件


效果圖

Vue中使用element-plus中的el-dialog定義彈窗-內(nèi)部樣式修改-v-model實(shí)現(xiàn)-demo,Vue,JavaScript,vue.js,javascript,前端,原力計(jì)劃文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-670740.html

實(shí)現(xiàn)代碼-封裝

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

<script setup>
import { defineProps, defineEmits, ref, reactive, computed } from 'vue';

const props = defineProps({
  modelValue: {
    type: Boolean,
    default: false
  },
  errType: {
    type: Object,
    default: {
      title: '恭喜您!注冊(cè)成功!',
      cont: '歡迎加入abcd!'
    }
  }
});

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">
.success-dialog {
  &.el-dialog {
    --el-dialog-bg-color: transparent !important;
    .el-dialog__header,
    .el-dialog__body {
      padding: 0;
    }
  }
}
</style>
<style lang="less" scoped>
.success-dialog {
  position: relative;
  .success-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>

?使用

<template>
  <NoCodeDialog v-model="isShowNoCodeDialog" />
  <SuccessDialog v-model="isSuccessDialog" />
</template>

<script setup>
import { ref } from 'vue';
import NoCodeDialog from '@/views/Register/components/NoCodeDialog.vue';
import SuccessDialog from '@/views/Register/components/SuccessDialog.vue';
const isShowNoCodeDialog = ref(true);
const isSuccessDialog = ref(true);
</script>

到了這里,關(guān)于Vue中使用element-plus中的el-dialog定義彈窗-內(nèi)部樣式修改-v-model實(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 Dialog對(duì)話框的使用 與 setup 寫法的使用

    一. 傳統(tǒng)寫法不使用setup語(yǔ)法糖 方式一:通過(guò) v-model 的方式實(shí)現(xiàn)子組件的顯示與隱藏 父組件的內(nèi)容 子組件內(nèi)容 方式二:通過(guò)為元素綁定 ref 的方式實(shí)現(xiàn)子組件的顯示與隱藏 父組件的內(nèi)容 子組件內(nèi)容 2. setup 語(yǔ)法糖寫法 父組件 子組件 總結(jié): 對(duì)于傳統(tǒng)寫法兩種方式來(lái)看,都有

    2024年02月09日
    瀏覽(30)
  • vue/Element UI 實(shí)現(xiàn)Element UI el-dialog 自由拖動(dòng)

    vue/Element UI 實(shí)現(xiàn)Element UI el-dialog 自由拖動(dòng)

    前言: 最近有個(gè)項(xiàng)目,客戶要求彈窗可拖動(dòng),但是由于elemen ui本身的彈窗并沒(méi)有拖動(dòng)的屬性,無(wú)法滿足客戶的需求。 于是我百度找到了幾篇文章,終于可以實(shí)現(xiàn)客戶的需求! 請(qǐng)往下看↓↓ 一、新建一個(gè)目錄:utils 二、創(chuàng)建drag .js文件 三、創(chuàng)建directive.js 文件 四、main.js文件中

    2024年02月02日
    瀏覽(33)
  • Vue系列第七篇:Element UI之el-main,el-table,el-dialog,el-pagination,el-breadcrumb等控件使用

    Vue系列第七篇:Element UI之el-main,el-table,el-dialog,el-pagination,el-breadcrumb等控件使用

    本篇實(shí)現(xiàn)主頁(yè)面功能,包括主頁(yè)面排版布局,學(xué)生管理模塊實(shí)現(xiàn),后臺(tái)接口實(shí)現(xiàn)等功能。 目錄 1.運(yùn)行效果 1.1登錄頁(yè)面 1.2主頁(yè)面 ?1.3學(xué)生管理 - 信息列表 1.4學(xué)生管理 - 信息管理 ?1.5學(xué)生管理 - 作業(yè)列表 1.6學(xué)生管理 -?作業(yè)管理 2.前端代碼 2.1 代碼結(jié)構(gòu) ?2.2 代碼實(shí)現(xiàn) 3.后端代碼

    2024年02月08日
    瀏覽(28)
  • vue使用element-ui或者element-plus固定 el-header 和 el-aside

    vue使用element-ui或者element-plus固定 el-header 和 el-aside

    vue使用element-ui或者element-plus固定 el-header 和 el-aside 在使用element-plus做后臺(tái)管理的時(shí)候,需要固定el-header和el-aside,特此記錄以下。 只需要將el-main固定高度即可。 main.vue css 將 el-main 高度后,當(dāng) el-main 內(nèi)容超出固定高度后就能顯示滾輪了。將滾輪樣式修改一下就好了。 效果:

    2024年02月13日
    瀏覽(26)
  • vue3使用element-plus 樹組件(el-tree)數(shù)據(jù)回顯

    html搭建結(jié)構(gòu) js 非常好用,拿過(guò)來(lái)修改一下check事件,ref獲取就直接可以使用了?

    2024年04月09日
    瀏覽(99)
  • VUE寶典之el-dialog使用

    el-dialog是Element UI庫(kù)中的一個(gè)重要組件,用于在Vue應(yīng)用程序中創(chuàng)建彈出框。它提供了一組實(shí)用的屬性和事件,讓我們能夠輕松地實(shí)現(xiàn)各種彈出框功能。本文將詳細(xì)介紹el-dialog組件的使用方法和示例,幫助您更好地理解如何在實(shí)際項(xiàng)目中使用它。 el-dialog是一個(gè)非常靈活的彈出框

    2024年02月04日
    瀏覽(20)
  • Vue項(xiàng)目element-ui彈窗組件el-dialog、el-drawer,阻止點(diǎn)擊遮罩層關(guān)閉

    Vue項(xiàng)目element-ui彈窗組件el-dialog、el-drawer,阻止點(diǎn)擊遮罩層關(guān)閉

    效果圖: 我們只需要設(shè)置這兩個(gè) 屬性 append-to-body :close-on-click-modal=“false” 注意 : 這里的close-on-click-modal屬性前需要寫入 :

    2024年02月12日
    瀏覽(33)
  • element UI組件庫(kù)el-dialog內(nèi)程序刷新el-dialog內(nèi)組件方法

    1、牢牢記住,vue是基于JavaScript ES6的,所以只要刷新頁(yè)面里面data下的數(shù)據(jù),頁(yè)面會(huì)自動(dòng)刷新的。 所以這個(gè)數(shù)據(jù)是父頁(yè)面?zhèn)鹘oel-dialog的,要刷新父頁(yè)面的數(shù)據(jù),el-dialog頁(yè)面內(nèi)的組件就可以刷新了。 2、在頁(yè)面的組件處理后臺(tái)程序完成后,可以調(diào)用 that.$parent.$parent.【父頁(yè)面的方

    2024年02月13日
    瀏覽(27)
  • vue 基于element-plus el-button封裝按鈕組件

    封裝組件的原則是:組件只是數(shù)據(jù)流通的一個(gè)管道,不要糅合太多的邏輯在里面,是一個(gè)純組件,還要根據(jù)自己項(xiàng)目的業(yè)務(wù)場(chǎng)景做具體的處理。

    2024年02月10日
    瀏覽(22)
  • 【element-ui】el-dialog改變寬度

    dialog默認(rèn)寬度為父元素的50%,這就導(dǎo)致在移動(dòng)端會(huì)非常的窄,如圖1,需要限定寬度。 解決方法:添加 custom-class 屬性,然后在style中編寫樣式, 注意 ,如果有 scoped 限定,需要加 ::v-deep

    2024年02月11日
    瀏覽(34)

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

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

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

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

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包