focus: {
inserted: function(el, { modifiers: { noKeyboard } }) {
try {
const tagName = el.tagName;
if (tagName !== 'INPUT') {
const child = el.children[0];
if (child && child.tagName === 'INPUT') {
el = child;
}
}
el.focus();
if (noKeyboard) {
el.setAttribute('readonly', 'readonly');
var timer = null;
timer = setTimeout(() => {
el.removeAttribute('readonly');
clearTimeout(timer);
}, 100);
}
} catch (error) {
throw new Error(error);
}
}
},
、这段代码什么意思啊?insert的参数是固定的吗?
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-