码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • element-plus-自定义Dialog样式


    实现如下

    1. <template>
    2. <h3>dialog3 test 全局</h3>
    3. <el-button type="primary" size="default" @click="show">全局弹窗</el-button>
    4. <div class="">
    5. <!-- 弹窗 -->
    6. <el-dialog v-model="visible" :show-close="false" append-to-body class="myDialogClass">
    7. <!--弹窗标题-->
    8. <template #header="{ close, titleId }">
    9. <div class="myDialogHeader">
    10. <span :id="titleId" class="dlgTitleClass" style="margin: 10px 10px;">提示</span>
    11. <el-button style="margin: 8px;" type="info" :icon="CircleCloseFilled" circle @click="close" size="small">
    12. <el-icon style="font-size: 26px;" color="#ffffff"><CircleCloseFilled /></el-icon>
    13. </el-button>
    14. </div>
    15. </template>
    16. This is dialog content.
    17. <!--弹窗底部-->
    18. <template #footer>
    19. <span class="myDialogFooter">
    20. <el-button type="primary" @click="visible = false">确定</el-button>
    21. <el-button type="primary" @click="visible = false">取消</el-button>
    22. </span>
    23. </template>
    24. </el-dialog>
    25. </div>
    26. </template>
    27. <script>
    28. import { ref } from 'vue'
    29. export default {
    30. setup() {
    31. const visible = ref(false);
    32. function show() {
    33. //console.log('show',visible)
    34. visible.value = true;
    35. }
    36. return { show, visible}
    37. }
    38. }
    39. </script>
    40. <style scoped>
    41. .myDialogClass {
    42. /*scoped 模式下 background-color 不生效 直接写到style*/
    43. background-color: rgb(224,242,241) !important;
    44. border-radius: 10px;
    45. }
    46. .myDialogClass .dlgTitleClass
    47. {
    48. color: rgb(26,147,144);
    49. }
    50. .el-dialog .el-dialog__header
    51. {
    52. margin: 0px !important;
    53. padding: 0px !important;
    54. padding-left: 0px !important;
    55. }
    56. .el-dialog .myDialogHeader {
    57. display: flex;
    58. flex-direction: row;
    59. justify-content: space-between;
    60. height: 40px;
    61. /* background-color: #ff00ff; */
    62. border-bottom: 1px solid rgb(42,155,152);
    63. margin: 0px 10px;
    64. font-size: 18px;
    65. font-weight: bolder;
    66. }
    67. .el-dialog .el-dialog__footer
    68. {
    69. padding: 10px;
    70. }
    71. .myDialogFooter .el-button
    72. {
    73. border-color: rgb(42,155,152);
    74. background-color: rgb(242,249,249);
    75. color: rgb(42,155,152);
    76. }
    77. </style>

  • 相关阅读:
    手把手教你部署Jenkins教程,小白也能学会(多图预警)!
    KSO - docker部署Rabbitmq的详细讲解以及各种隐藏坑
    为什么你的抖店没流量,不出单怎么办?教你抖音自然流量爆单玩法
    分布式架构下如何选择最佳 Store?
    C++ 背包问题——01背包
    2023研究生数学建模D题思路
    R语言 一种功能强大的数据分析、统计建模 可视化 免费、开源且跨平台 的编程语言
    NOIP2023模拟16联测37 D. 小猫吃火龙果
    c# 定时器
    Boss Rush (二分答案 + 状压DP)
  • 原文地址:https://blog.csdn.net/chyuanrufeng/article/details/133266920
  • 最新文章
  • 沪漂五周年了:我越来越迷茫了
    Agentic Skill Routing 实战:别再把所有 Skill 塞进 AI Agent 上下文
    MySQL-Seconds_behind_master的精度误差
    [MAF预定义ChatClient中间件-03]CachingChatClient——利用缓存省钱省时间
    AI的至暗历史:从万众期待到被政府撤资,AI的两次死亡徘徊
    Agent OS :五种驯服不确定性的范式
    PortSwigger SQL注入LAB11
    数据库即时编译JIT
    [Begin]AI Learn Data Day 0
    深度学习进阶(二十七)现代 LLM 的核心架构设计其二:SwiGLU
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号