ElementUI defines default size? when introduced on demand


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
  1. is introduced in full in Vue, you can use Vue.use (Element, {size: "small"}) to set the default size for global components.
  2. 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?

Apr.09,2021

< button size= "small" > < btton >
when the tag takes advantage of


import Vue from 'vue'
import { Button } from 'element-ui'

Vue.prototype.$ELEMENT = { size: 'mini' };

Vue.use(Button)

does not take effect. Versions above X seem to be valid.

Menu