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'
})
})
// Import on demand,加 {size: 'small'} 不生效
两种情况:
- 在 Vue 中全量引入时,可以使用
Vue.use(Element, {size: 'small'})
设置全局组件的默认size。 - 在 Vue 中按需引入时,使用
Vue.use(Button, {size: 'small'})
,设置无效。
问题是:在按需引入时 我写的有问题还是不支持组件的默认size定义?
<button size="small"><btton>
在标签利用