nuxtjs组合element

2019-08-13 08:56:46

1.添加elementUI 插件,plugins->ele.js,代码如下

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


在nuxt.config.js中配置这个插件

plugins: [
  '~/plugins/route',
  {src:'~/plugins/ele',
  ssr:true}
],

2.引入element样式

css: [
  'element-ui/lib/theme-chalk/index.css'
],


好了,按照以往写element的语法写就行了。

<el-button type="primary" @click="openVn">主要按钮</el-button>0
openVn() {
    this.$message('这是一条消息提示');

}


  • 2020-05-21 10:56:53

    fixed z-index失效

    作为一个假的前端,在调试一个页面时出现了如下bug。 左侧的菜单固定为fixed时,二级菜单无法设置有效的z-index,导致菜单隐藏在页面元素之下,明明页面元素的z-index是1,但是无论把菜单的z-index设置为多大,都不管用。

  • 2020-05-24 08:10:18

    echarts标题(title)配置

    show:true,//显示策略,默认值true,可选为:true(显示) | false(隐藏) text: '主标题',//主标题文本,'\n'指定换行 link:'',//主标题文本超链接,默认值true target: null,//指定窗口打开主标题超链接,支持'self' | 'blank',不指定等同为'blank'(新窗口) subtext: '副标题',//副标题文本,'\n'指定换行 sublink: '',//副标题文本超链接