引入第三方组件
Element-ui
/plugins/element-ui.js1
2
3
4
5
6
7import Vue from 'vue'
import Element from 'element-ui/lib/element-ui.common'
import locale from 'element-ui/lib/locale/lang/en'
export default () => {
Vue.use(Element, {locale})
}
nuxt.config.js1
2
3
4
5
6
7
8module.exports = {
plugins: [
'@/plugins/element-ui'
],
css: [
'element-ui/lib/theme-default/index.css'
]
}
VueAwesomeSwiper
/plugins/swiper.js1
2
3
4import Vue from 'vue'
import VueAwesomeSwiper from 'vue-awesome-swiper/ssr'
Vue.use(VueAwesomeSwiper)
nuxt.config.js1
2
3
4
5
6
7
8module.exports = {
plugins: [
{src: '~/plugins/swiper.js', ssr: false},
],
css: [
'swiper/dist/css/swiper.css'
]
}