import Vue from 'vue'import Element from 'element-ui'import 'element-ui/lib/theme-chalk/index.css'Vue.use(Element, { size: 'small'})// Fully import, 在 Vue.use 中加 {size: 'small'} 生效import Vue from 'vue'import { Button, Input } from 'element-ui'const Elements = [Button, Input]
Elements.forEach(key => {
Vue.use(key, { size: 'small'
})
})兩種情況:在 Vue 中全量引入時,可以使用 Vue.use(Element, {size: 'small'}) 設置全局組件的默認size。在 Vue 中按需引入時,使用 Vue.use(Button, {size: 'small'}),設置無效。問題是:在按需引入時 我寫的有問題還是不支持組件的默認size定義?
添加回答
舉報
0/150
提交
取消