element-ui-ykx

1.2.10 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i element-ui-ykx

Weekly Downloads

5

Version

1.2.10

License

MIT

Last publish

Collaborators

  • zhangrongliang