ElementUI 全局设置组件的原生默认属性
props
import ElementUI from 'element-ui'
Element.Input.props.clearable.default = true;
原生属性
- 通常情况下,以maxlength属性为例
import ElementUI from 'element-ui'
const render = ElementUI.Input.render;
ElementUI.Input.render = function () {
// 设置组件默认原生属性(attr)
this.$attrs.maxlength || (this.$attrs.maxlength = 2);
return render.apply(this, arguments)
}
本文来自博客园,作者:懒惰ing,转载请注明原文链接:https://www.cnblogs.com/landuo629/p/17039592.html