• 快应用dialog弹窗组件


    components中封装的组件

    
    <template>
        <div>
            <stack class="dialog" if="{{isDialog}}">
                <div class="dialog-container">
                    <div class="dialog-title"><text>{{title}}</text></div>
                    <div class="content"><text>{{content}}</text></div>
                    <div class="btns">
                        <div if="type != 'confirm'" class="default-btn" @click="closeBtn">
                            <text class="text">{{cancelText}}</text>
                            <text class="border-right"></text>
                        </div>
                        <div if="type == 'confirmGo'" class="confirm-btn" @click="confirmBtn">
                            <text> {{confirmText}}</text>
                        </div>
                    </div>
    
                </div>
            </stack>
        </div>
    </template>
    <script>
    export default {
        props: {
            isDialog: {
                type: Boolean,
                default: false
            },
            // 类型包括 defalut 默认, danger 危险, confirm 确认,
            type: {
                type: String,
                default: 'default'
            },
            content: {
                type: String,
                default: ''
            },
            title: {
                type: String,
                default: '我是标题'
            },
            cancelText: {
                type: String,
                default: '取消'
            },
            confirmText: {
                type: String,
                default: '确认'
            },
    
        },
        data: {
        },
        closeBtn() {
            this.$emit('cancel');
        },
        confirmBtn() {
            this.$emit('confirm');
        },
    }
    </script>
    <style lang="less" >
    .dialog {
      position: fixed;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      background-color: rgba(0, 0, 0, 0.6);
    
      .dialog-container {
        /*  530px; */
        /* height: 221px; */
        background-color: #ffffff;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        border-radius: 8px;
        margin: auto;
        border-radius: 10px;
        .dialog-title {
          color: #696969;
          text {
          }
        }
        .content {
           100%;
          height: 123px;
          color: #797979;
          text {
            height: 123px;
            font-size: 30px;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: rgba(0, 0, 0, 0.8);
            line-height: 123px;
            text-align: center;
            margin-left: 56px;
          }
        }
    
        .btns {
           100%;
          height: 98px;
          text-align: right;
          padding: 0 16px;
          .default-btn {
             265px;
            height: 98px;
            border-top: 1px solid #eee;
            .text {
               60px;
              height: 98px;
              font-size: 30px;
              font-family: PingFangSC-Regular, PingFang SC;
              font-weight: 400;
              color: rgba(76, 159, 255, 1);
              line-height: 98px;
              text-align: center;
              margin: auto;
            }
            .border-right {
              height: 48px;
               1px;
              background-color: #eee;
              margin: 25px 0px;
            }
          }
          .confirm-btn {
             265px;
            height: 98px;
            border-top: 1px solid #eee;
            text {
               60px;
              height: 98px;
              font-size: 30px;
              font-family: PingFangSC-Regular, PingFang SC;
              font-weight: 400;
              color: rgba(76, 159, 255, 1);
              line-height: 98px;
              text-align: center;
              margin: auto;
            }
          }
        }
      }
    }
    </style>
    
    

    引入的方法

    <import name="dialog-bar" src="../../components/dialogConfig/index.ux"></import>
    <template>
        <div class="home-page">
            <dialog-bar is-dialog="{{sendVal}}" type="confirmGo" title="" content="确定要删除全部历史记录吗?" oncancel="clickCancel()" onconfirm="clickConfirm()"></dialog-bar>
        </div>
    </template>
    
    clickCancel() {
             console.log(‘取消’)
        },
       clickConfirm() {
            
            console.log(‘确认’)
        },
    
  • 相关阅读:
    shell脚本
    Dockerfile
    【剑灵攻略】003、XXXfragment that is not a fragment错误,fragment认不出来
    【剑灵攻略】002、android工程引用方式
    【剑灵攻略】001、底部菜单栏实现
    ViewPager动画切换
    android raw与assets区别
    android+eclipse+maven环境搭建
    解决在IE8中无法使用原生JSON的问题
    Windows Phone Toast通知
  • 原文地址:https://www.cnblogs.com/guanhuohuo/p/12526144.html
Copyright © 2020-2023  润新知