1.2.10 • Published 7 years ago

element-ui-ykx v1.2.10

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Links

update message-box $prompt

<template>
  <el-button type="text" @click="open3">点击打开 Message Box</el-button>
</template>

<script>
  export default {
    methods: {
      open3() {
        this.$prompt('请输入邮箱', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
          inputErrorMessage: '邮箱格式不正确',
          showChecked: true,      //showChecked: 是否显示checked,type:boolean,默认为false
          isChecked: true,        //isChecked: checked状态,type:boolean,默认为true
          checkedText: '推送到APP'//checkedText: checked描述文字,type:string
        }).then(({ value }) => {
          this.$message({
            type: 'success',
            message: '你的邮箱是: ' + value
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '取消输入'
          });       
        });
      }
    }
  }
</script>

此功能用法详解: element-ui