Nuxt.js中引入ElementUI

nuxt.config.js中配置

module. exports = {
/*
** Headers of the page
*/
head: {
title: 'front',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: 'nwy blog front' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
},
css:[
{ src: 'element-ui/lib/theme-chalk/index.css'}
],
/*
** Customize the progress bar color
*/
loading: { color: '#3B8070' },

plugins: [{ src: '~plugins/element-ui', ssr: false}],
/*
** Build configuration
*/
build: {
vendor: [ 'element-ui']
}
}


plugins/element-ui.js中内容为:

import Vue from 'vue'
import Element from 'element-ui'
Vue. use( Element);


猜你喜欢

转载自blog.csdn.net/nongweiyilady/article/details/79045745