The element-ui button component sets the size globally

The element-ui button component sets the size globally

element-ui official manual

Global configuration

When introducing Element, you can pass in a global configuration object. The object currently supports  size and  zIndex fields. size Used to change the default size of the component and zIndex set the initial z-index of the bullet frame (default value: 2000). According to the way of introducing Element, the specific operations are as follows:

Complete introduction of Element:

import Vue from 'vue';
import Element from 'element-ui';
Vue.use(Element, { size: 'small', zIndex: 3000 });

Introduce Element on demand:

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

Vue.prototype.$ELEMENT = { size: 'small', zIndex: 3000 };
Vue.use(Button);

According to the above settings, size the default size of all components with attributes in the project  is'small', and the initial z-index of the popup is 3000.

//在index.js文件中 设置size
Vue.use(Element, { size: 'small'});

 

Guess you like

Origin blog.csdn.net/cmax007/article/details/106411475