<script>
export default {
  data() {
    return {
      isEye:true,
      modShow:false,
      forgetPwd:false,
    }
  },
  created() {},
  methods: {
    openEdit(){
      this.modShow=true;
      this.forgetPwd=false;
    },
    openForget(){
      this.modShow=true;
      this.forgetPwd=true;
    },
    handleCode(){
      //ajax代码
      this.$refs.editPassword.countSum();
    },
    handleLogin(formInline){
    },
    handleReset(){
      this.modShow=false
    }
  }
}
</script>
<style lang="less" scoped>
  .demo-block {
    >div {
      margin-bottom: 20px;

      &:last-child {
        margin-bottom: 0;
      }
    }
  }
</style>

# 强制修改密码弹框

----
采用`iview-ui`中的样式变量，简化功能，熟悉 css \(^o^)/~。

### 基础用法

- 强制修改密码弹框可用作忘记密码弹框，isForget字段为true时为忘记密码弹框，false为强制修改密码登录框

<div class="demo-block">
  <h-button type="primary" @click="openEdit">显示强制修改密码弹框</h-button>
  <h-button type="primary" @click="openForget">显示忘记密码弹框</h-button>
  <div>
      <h-editPasswordFrame
         ref="editPassword"
         :modShow="modShow"
         :isForget="forgetPwd"
         :isEye="isEye"
         @handleCode="handleCode"
         @handleLogin="handleLogin"
         @handleReset="handleReset">
      </h-editPasswordFrame>
  </div>
</div>

:::demo





```html
  <div>
      <h-editPasswordFrame
         ref="editPassword"
         :modShow="modShow"
         :isForget="forgetPwd"
         :isEye="isEye"
         @handleCode="handleCode"
         @handleLogin="handleLogin"
         @handleReset="handleReset">
      </h-editPasswordFrame>
  </div>
  <script>
 export default {
  data() {
    return {
      isEye:true,
      modShow:false,
      forgetPwd:false,
    }
  },
  created() {},
  methods: {
      handleReset(val){
        this.modShow=val
      },
      handleLogin(form){
        // form为表单对象
        //ajax代码
      },
      handleCode(){
         //ajax代码
         this.$refs.editPassword.countSum();
      },
  }
}
</script>

```
:::
### Attributes
| 参数                | 说明                       | 类型   | 可选值 | 默认值 |
| ------------        | --------------------      | ------ | ------ | ------ |
| modShow             | 是否显示弹框             | Boolean  | -   | false       |
| isEye               | 显示/隐藏密码               | Boolean  | -      | false |
| isForget               | 强制修改密码弹框/忘记密码弹框             | Boolean  | -      | false |
| companyEmail        | 邮箱账号字段名              | String | -        | companyEmail|
| code                | 验证码字段名                  | String  | -      | code  |
| onePwd              | 原密码/新的密码 字段名 | String  | -      | onePwd  |
| secPwd              | 新的密码/确认密码 字段名| String  | -   | secPwd  |





### Events
| 事件名         | 说明             | 参数                       |
| -------------- | ---------------- | ---------------------------- |
| @handleCode | 点击验证码触发的方法 | —— |
| @handleLogin | 点击登录触发的方法 | —— |
| @handleReset | 关闭弹框触发的方法 |  ——|



### Methods
| 方法名         | 说明             | 返回值                       |
| -------------- | ---------------- | ---------------------------- |
| countSum | 倒计时功能 | —— |

