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

}


  • 2018-10-28 10:50:26

    VectorDrawable简单介绍

    在项目中使用矢量图至少可以缩小我们apk包的尺寸,而且可以在屏幕适配时提供很大的方便,因为矢量图是分辨率无关的。

  • 2018-10-28 11:14:29

    矢量资源工具Vector_Asset_Studio

    Android Studio有一个称为“Vector Asset Studio”的工具, 它可以将SVG文件和PSD文件转化为工程可用的矢量可绘制资源(vector drawable resources),

  • 2018-10-28 11:16:09

    Android vector标签 PathData 画图超详解

    SVG是一种矢量图格式,是Scalable Vector Graphics三个单词的首字母缩写。在xml文件中的标签是<vector>,画出的图形可以像一般的图片资源使用,例子如下

  • 2018-10-30 00:16:41

    android ToolBar 设置颜色

    app:popupTheme——有时候我们有需求:ActionBar文字是白的,ActionBar Overflow弹出的是白底黑字让ActionBar文字是白的,那么对应的theme肯定是Dark。可是让ActionBar弹出的是白底黑字,那么需要Light主题。这时候popupTheme就派上用场了。android:theme 与app:theme——在AppCompat v21里,提供了一个快速方便的方法设置Toolbar的主题,使用app:theme。而新版本22.1.x中,AppCompat 允许对 Toolbar 使用 android:theme代替 app:theme。最好的一点是:它会自动继承父视图的theme ,并且兼容所有APIv11以上的设备。