From 75460ce6bd017f5243cb72b4ffb586bf1b325f4f Mon Sep 17 00:00:00 2001
From: FEI <1556610925@qq.com>
Date: Sun, 29 Jan 2023 12:04:23 +0800
Subject: [PATCH] input upgrade
---
src/components/input/input.vue | 207 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------
src/mixins/form.js | 14 ++++++++++++++
2 files changed, 164 insertions(+), 57 deletions(-)
create mode 100644 src/mixins/form.js
diff --git a/src/components/input/input.vue b/src/components/input/input.vue
index 0af953b..2d8498c 100644
--- a/src/components/input/input.vue
+++ b/src/components/input/input.vue
@@ -2,10 +2,15 @@
-
+
+ {{ textLength }}/{{ upperLimit }}
+
+
+
+
@@ -14,10 +19,10 @@
:autocomplete="autocomplete"
:spellcheck="spellcheck"
ref="input"
- :type="type"
+ :type="currentType"
:class="inputClasses"
:placeholder="placeholder"
- :disabled="disabled"
+ :disabled="itemDisabled"
:maxlength="maxlength"
:readonly="readonly"
:name="name"
@@ -42,46 +47,49 @@
-
+
+
+ {{ textLength }}/{{ upperLimit }}
+
diff --git a/src/mixins/form.js b/src/mixins/form.js
new file mode 100644
index 0000000..d4f3243
--- /dev/null
+++ b/src/mixins/form.js
@@ -0,0 +1,14 @@
+export default {
+ inject: {
+ FormInstance: {
+ default: ''
+ }
+ },
+ computed: {
+ itemDisabled () {
+ let state = this.disabled;
+ if (!state && this.FormInstance) state = this.FormInstance.disabled;
+ return state;
+ }
+ }
+};
--
libgit2 0.21.4