diff --git a/src/core/view/components/input/index.vue b/src/core/view/components/input/index.vue index a4852f9beaf646180d0eb43dff14cdc40e912144..1fa736b2c6c5f23541f9e7199219d99f1fed630a 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 () {