import Vue from "vue"
import { Button, Input } from "element-ui"
const Elements = [Button, Input]
Elements.forEach(key => {
Vue.use(key, {
size: "small"
})
})
// Import on demand {size: "small"}
two cases:
-
When
- is introduced in full in Vue, you can use
Vue.use (Element, {size: "small"})
to set the default size for global components. - when introduced on demand in Vue, use
Vue.use (Button, {size: "small"})
, the setting is invalid.
the question is: did I write something wrong with the on-demand introduction or did I not support the default size definition of the component?