From 4f32a0f2732398ffba5a55c6dafd73df922c1891 Mon Sep 17 00:00:00 2001 From: qiang Date: Thu, 4 Jul 2019 20:43:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=9C=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=86=85=E5=AE=9A=E4=B9=89=20input=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=20placeholder-class=20=E6=97=A0=E6=95=88?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/view/components/input/index.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/view/components/input/index.vue b/src/core/view/components/input/index.vue index a4852f9be..1fa736b2c 100644 --- a/src/core/view/components/input/index.vue +++ b/src/core/view/components/input/index.vue @@ -144,7 +144,7 @@ export default { }, mounted () { if (this.confirmType === 'search') { - var formElem = document.createElement('form') + const formElem = document.createElement('form') formElem.action = '' formElem.onsubmit = function () { return false @@ -154,6 +154,15 @@ export default { this.$refs.wrapper.appendChild(formElem) } + let $vm = this + while ($vm) { + const scopeId = $vm.$options._scopeId + if (scopeId) { + this.$refs.placeholder.setAttribute(scopeId, '') + } + $vm = $vm.$parent + } + this.focus && this._focusInput() }, beforeDestroy () { -- GitLab