| | |
| | | </template> |
| | | |
| | | <script> |
| | | import buttonClickMixin from '@/mixins/button-click.js'; |
| | | |
| | | export default { |
| | | |
| | | name: "OIFormInput", |
| | | mixins: [buttonClickMixin], |
| | | props: { |
| | | viewMode: { |
| | | type: Boolean, |
| | |
| | | }, |
| | | methods: { |
| | | onChange(e) { |
| | | this.$emit("change", e) |
| | | this.$emit("on-change", e) |
| | | }, |
| | | onConfirm(e) { |
| | | console.log("onConfirm") |
| | | this.onChange(e) |
| | | }, |
| | | onClick(e) { |
| | | this.$emit("click", e) |
| | | }, |
| | | onFocus(e) { |
| | | this.$emit("focus", e) |
| | | this.$emit("on-focus", e) |
| | | }, |
| | | onPrefixButton() { |
| | | this.$emit("click-prefix") |
| | | this.handleButtonClick((done) => { |
| | | this.$emit("on-click-prefix") |
| | | setTimeout(() => { |
| | | done(); // 重置状态 |
| | | }, 1000); |
| | | }); |
| | | }, |
| | | onSuffixButton() { |
| | | this.$emit("click-suffix") |
| | | |
| | | this.handleButtonClick((done) => { |
| | | this.$emit("on-click-suffix") |
| | | setTimeout(() => { |
| | | done(); // 重置状态 |
| | | }, 1000); |
| | | }); |
| | | |
| | | |
| | | }, |
| | | } |
| | | }, |
| | | |
| | | }; |
| | | </script> |
| | | |