打开弹出框
当前位置:   article > 正文

Vue中el-dialog修改样式_el-dialog样式修改

el-dialog样式修改

弹窗打开关闭时关闭默认的过渡动画效果:(需要全局修改。在scoped中用:deep()改不动)

  1. <style>
  2. .dialog-fade-enter-active {
  3. animation: none !important;
  4. }
  5. .dialog-fade-leave-active {
  6. animation: none !important;
  7. }
  8. </style>

效果图: 

 使用:

  1. <template>
  2. <div>
  3. <LjButton @click="dialogVisible = true">打开弹出框</LjButton>
  4. <div class="LjDialog">
  5. <el-dialog
  6. title=""
  7. :visible.sync="dialogVisible"
  8. :modal-append-to-body="false"
  9. :close-on-click-modal="false"
  10. :modal="false"
  11. width="55%"
  12. :show-close="true"
  13. >
  14. hello 大家好
  15. <div class="LjDialog-footer">
  16. <slot name="footer">
  17. <LjButton
  18. style="margin: 0 10px"
  19. type="danger"
  20. @click="dialogVisible = false"
  21. >取 消</LjButton
  22. >
  23. <LjButton type="primary" @click="dialogVisible = false"
  24. >确 定</LjButton
  25. >
  26. </slot>
  27. </div>
  28. </el-dialog>
  29. </div>
  30. </template>
  31. <script>
  32. import LjButton from "@/components/LjButton/index.vue";
  33. export default {
  34. name: "",
  35. components: {
  36. LjButton
  37. },
  38. props: {},
  39. data() {
  40. return {
  41. dialogVisible: false
  42. };
  43. },
  44. computed: {},
  45. created() {},
  46. mounted() {},
  47. filters: {},
  48. methods: {},
  49. watch: {},
  50. };
  51. </script>
  52. <style lang="scss" scoped>
  53. .LjDialog {
  54. ::v-deep .el-dialog {
  55. background-color: #091f2cee;
  56. border: 1px solid rgb(13, 210, 236);
  57. .el-dialog__title {
  58. color: white;
  59. caret-color: transparent;
  60. }
  61. .el-icon-close {
  62. color: white;
  63. &:hover {
  64. color: rgb(9, 205, 219);
  65. }
  66. }
  67. .el-dialog__body {
  68. color: white;
  69. font-size: 18px;
  70. }
  71. .LjDialog-footer {
  72. text-align: right;
  73. margin: 30px 0 0 0;
  74. }
  75. }
  76. }
  77. </style>

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/120789?site
推荐阅读
相关标签