vue-element-admin修改默认的全局字体尺⼨为mini vue-element-admin是⼀套相当不错的后台管理UI框架, 默认字体尺⼨是Medium。
如果想修改默认尺⼨为Mini ,那么只需要修改src/main.js 路径下的⽂件第34⾏即可。
Vue.use(Element,{
size: ('size')||'mini',// set element-ui default size
locale: enLang // 如果使⽤中⽂,⽆需设置,请删除
})
完整⽂件内容修改后如下:
import Vue from'vue'
import Cookies from'js-cookie'
import'normalize.css/normalize.css'// a modern alternative to CSS resets
import Element from'element-ui'
import'./styles/element-variables.scss'
import enLang from'element-ui/lib/locale/lang/en'// 如果使⽤中⽂语⾔包请默认⽀持,⽆需额外引⼊,请删除该依赖import'@/styles/index.scss'// global css
import App from'./App'
import store from'./store'
import router from'./router'
import'./icons'// icon
import'./permission'// permission control
import'./utils/error-log'// error log
vue element adminimport*as filters from'./filters'// global filters
import{ krryCascader, krryPaging }from'krry-transfer'
/**
* If you don't want to use mock-server
* you want to use MockJs for mock api
* you can execute: mockXHR()
*
* Currently MockJs will be used in the production environment,
* please remove it before going online ! ! !
*/
v.NODE_ENV==='production'){
const{ mockXHR }=require('../mock')
mockXHR()
}
Vue.use(Element,{
size: ('size')||'mini',// set element-ui default size
locale: enLang // 如果使⽤中⽂,⽆需设置,请删除
})
// register global utility filters
Object.keys(filters).forEach(key =>{
Vue.filter(key, filters[key])
})
Vue.use(krryCascader)
Vue.use(krryPaging)
new Vue({
el:'#app',
router,
store,
render: h =>h(App)
})
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论