Skip to content

Conversation

@yoyo201626
Copy link
Collaborator

v3.12.0

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

type= 'textarea'type='password'相互改变,value值会被清空

Issue Number: N/A

What is the new behavior?

type= 'textarea'type='password'相互改变,value值不会被清空

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

// test case
<template>
  <div class="demo-input">
    <tiny-input v-model="state.formData.input" placeholder="Please input" :type="state.type"></tiny-input>
    <tiny-input v-model="state.formData.input" placeholder="Please input"></tiny-input>
    <tiny-button @click="state.type=state.type==='textarea'? 'password': 'textarea'">change type</tiny-button>
    <tiny-button @click="state.formData.input=''">clear</tiny-button>
  </div>
</template>

<script>
import { Input, Button } from '@opentiny/vue'

export default {
  components: {
    TinyInput: Input,
    TinyButton: Button,
  },
  data() {
    return {
      state: {
        type: 'textarea',
        formData: {
          input:''
        }
      }
    }
  }
}
</script>

<style scoped>
.demo-input .tiny-input {
  width: 250px;
}
</style>

@yoyo201626 yoyo201626 force-pushed the fix/input-type-change branch 3 times, most recently from f74745b to 1b6393b Compare December 5, 2023 02:34
@yoyo201626 yoyo201626 added the bug Something isn't working label Dec 5, 2023
@yoyo201626 yoyo201626 force-pushed the fix/input-type-change branch 2 times, most recently from f6360f6 to 1b6393b Compare December 5, 2023 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants