提交 4f32a0f2 编写于 作者: Q qiang

fix: 解决在组件内定义 input 组件的 placeholder-class 无效的问题

上级 b7c5ff9e
......@@ -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 () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册