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('这是一条消息提示');

}


  • 2017-02-24 15:53:02

    PHP中__get()和__set()的用法实例详解

    在PHP5中,预定义了两个函数“__get()”和“__set()”来获取和赋值其属性,对每个字段进行set和get的操作。只需要加上两个魔术方法即可

  • 2017-02-24 16:53:58

    PHP 中的Closure

    Closure,匿名函数,又称为Anonymous functions,是php5.3的时候引入的。匿名函数就是没有定义名字的函数。这点牢牢记住就能理解匿名函数的定义了。

  • 2017-03-02 09:45:27

    动态加载js和css

    开发过程中经常需要动态加载js和css,今天特意总结了一下常用的方法。