话不多说 笔记直接分享!!

一、自定义crud搜索栏组件

<template slot-scope="scope" slot="provinceCodeSearch">
  <avue-select
    v-model="objFrom.provinceCode" //这是存放省份的code
    placeholder="请选择省市"
    :dic="ProvinceList" //存放省份的下拉选择项
  ></avue-select>
</template>
column: [
  {
    showColumn: false,
    label: "省份",
    prop: "provinceCode",
    type: "select",
    search: true, //显示到search栏
    searchslot: true, //使用插槽
  },
]

二、自定义crud列表头部按钮

  旧版本写法:
    <template slot="menuLeft">
      <el-button size="small" type="primary" icon="el-icon-edit">添加</el-button>
    </template>

  新版本写法:
    <template #menu-left="{}">
      <el-button size="small" type="primary" icon="el-icon-edit">添加</el-button>
    </template>

三、自定义crud操作栏按钮

  旧版本写法:
    <template slot-scope="scope" slot="menu">
      <el-button type="text" icon="el-icon-view" size="small" @click.stop="handleView(scope.row,scope.index)">查看</el-button>
      <el-button type="text" icon="el-icon-edit" size="small" @click.stop="handleEdit(scope.row,scope.index)">编辑</el-button>
      <el-button type="text" icon="el-icon-delete" size="small" @click.stop="handleDel(scope.row,scope.index)">删除</el-button>
    </template>

  新版本写法:
    <template #menu="{row,index,size}">
      <el-button type="text" icon="el-icon-view" size="small" @click.stop="handleView(row,index)">查看</el-button>
      <el-button type="text" icon="el-icon-edit" size="small" @click.stop="handleEdit(row,index)">编辑</el-button>
      <el-button type="text" icon="el-icon-delete" size="small" @click.stop="handleDel(row,index)">删除</el-button>
    </template>


    // 调出查看方法
    handleView (row, index) {
      this.$refs.crud.rowView(row, index);
    },
    // 调出编辑方法
    handleEdit (row, index) {
      this.$refs.crud.rowEdit(row, index);
    },
    // 调出删除方法
    handleDel (row, index) {
      this.$refs.crud.rowDel(row, index);
    },

四、自定义crud列表显示字段值和样式

  旧版本写法:
    <template slot-scope="{row}" slot="pointId">
      <el-tag>{{row.pointIdName}}</el-tag>
    </template>

  新版本写法:
    <template #pointId="scope">
        <el-tag>{{row.pointIdName}}</el-tag>
    </template>

    column: [
      {
        label: "所属区域",
        prop: "pointId",
        slot: true, //插槽开启
      },
    ]

五、自定义form表单标题

  旧版本写法:
    <template slot-scope="{}" slot="businessRegisterMaterialLabel">
      <span>工商注册材料&nbsp;&nbsp;</span>
      <el-tooltip class="item" effect="dark" placement="bottom">
        <div slot="content" style="max-width:500px;">第一行文字提示<br/>第二行文字提示</div>
        <i class="el-icon-warning"></i>
      </el-tooltip>
    </template>

  新版本写法:
    <template #name-label="{}">
      <span>工商注册材料&nbsp;&nbsp;</span>
      <el-tooltip class="item" effect="dark" placement="bottom">
        <div slot="content" style="max-width:500px;">第一行文字提示<br/>第二行文字提示</div>
        <i class="el-icon-warning"></i>
      </el-tooltip>
    </template>

    column: [
      {
        label: "工商注册材料",
        prop: "businessRegisterMaterial",
        type: "select",
        labelslot:true, //使用插槽
      },
    ]

六、自定义form表单内容

  旧版本写法:
    <template slot="postIdsForm" slot-scope="scope">
      <el-cascader
        v-model="form.postIds"
        :options="postIdsOptions"
        :props="props"
        collapse-tags
        collapse-tags-tooltip
        clearable
        style="width: 100%;"
      />
    </template>

  新版本写法:
    <template #postIds-form="{row}">
      <el-cascader
        v-model="form.postIds"
        :options="postIdsOptions"
        :props="props"
        collapse-tags
        collapse-tags-tooltip
        clearable
        style="width: 100%;"
      />
    </template>

    column: [
      {
        label: "身份证",
        prop: "postIds",
        type: "select",
        formslot:true, //使用插槽
      },
    ]

七、自定义form表单弹窗内底部按钮

  旧版本写法:
    <template slot="menuForm">
      <el-button size="small" icon="el-icon-plus">签约缴费</el-button>
    </template>

  新版本写法:
    <template #menu-form="{}">
      <el-button size="small" icon="el-icon-plus">签约缴费</el-button>
    </template>

avue组件自定义按钮/标题/内容/搜索栏的更多相关文章

  1. Web jquery表格组件 JQGrid 的使用 - 5.Pager翻页、搜索、格式化、自定义按钮

    系列索引 Web jquery表格组件 JQGrid 的使用 - 从入门到精通 开篇及索引 Web jquery表格组件 JQGrid 的使用 - 4.JQGrid参数.ColModel API.事件 ...

  2. IOS 修改UIAlertController的按钮标题的字体颜色,字号,内容

    IOS 修改UIAlertController的按钮标题的字体颜色,字号,内容 UIAlertController *alertVC = [UIAlertController alertControl ...

  3. Flutter 中的常见的按钮组件 以及自定义按钮组件

    Flutter 里有很多的 Button 组件很多,常见的按钮组件有:RaisedButton.FlatButton. IconButton.OutlineButton.ButtonBar.Float ...

  4. 22Flutter中的常见的按钮组件 以及自定义按钮组件

    /* Flutter中的常见的按钮组件 以及自定义按钮组件 一.Flutter中的按钮组件介绍 Flutter里有很多的Button组件,常见的按钮组件有:RaisedButton/FlatButto ...

  5. php框架tp3.2.3和js写的微信分享功能心得,分享的标题内容图片自定义

    https://blog.csdn.net/weixin_42231483/article/details/81585322 最近用PHP的tp3.2.3框架和js写的微信分享功能心得,分享的标题内容 ...

  6. 如何让antd的Modal组件的确认和取消不显示(或自定义按钮)(转载)

    使用Modal中的footer属性,如下: <Modal title="更改成员" visible={visible} confirmLoading={confirmLoad ...

  7. 基于element-ui的后台系统表格、dialog、筛选、自定义按钮、分页的一次性封装

    方便基础业务开发封装的一套组件,基于vue2.5.x和element-ui,可以通过配置自动生成表格展示,表格新增.编辑功能.分页.筛选项.自定义显示表格数据等功能. 先上演示图片 --------- ...

  8. wordpress优化之结合prism.js为编辑器自定义按钮转化代码

    原文链接 http://ymblog.net/2016/07/24/wordpress-prism/ 继昨天花了一天一夜的时间匆匆写了主题Jiameil3.0之后,心中一直在想着优化加速,体验更好,插 ...

  9. Vue组件-使用插槽分发内容

    在使用组件时,我们常常要像这样组合它们: <app> <app-header></app-header> <app-footer></app-fo ...

  10. JOptionPane如何自定义按钮绑定事件

    JOptionPane如何自定义按钮绑定事件 2018年01月29日 19:27:10 阅读数:475 摘自:https://blog.csdn.net/m0_37355951/article/det ...

随机推荐

  1. TVM 代码生成—TIR to LLVM IR

    本文地址:https://www.cnblogs.com/wanger-sjtu/p/17573212.html TVM在编译过程中,经历了 graph LR A[3rd IR] --> B[R ...

  2. Jetty的server模块

    启用server模块,执行如下命令: java -jar $JETTY_HOME/start.jar --add-modules=server 命令的输出,如下: INFO : server init ...

  3. Linux:vscode扩展无法下载,报错:Error while fetching extensions : XHR failed

    在Linux系统上下载安装好vscode以后,发现扩展里面无法下载安装,报错:Error while fetching extensions : XHR failed 解决办法:修改 hosts 文件 ...

  4. 前端使用 Konva 实现可视化设计器(3)

    github/gitee Star 终于有几个了! 从这章开始,难度算是(或者说细节较多)升级,是不是值得更多的 Star 呢?! 继续求 Star ,希望大家多多一键三连,十分感谢大家的支持~ 创作 ...

  5. 玩转HarmonyOS专项测试,轻松上架“五星”高品质应用

      作者:David,华为测试服务专家 随着信息技术的高速发展,移动应用与人们生活日益紧密,面向各类场景的应用层出不穷,什么样的应用更受用户青睐呢?在满足用户功能需求之上,一个好的应用要能运行稳定.流 ...

  6. nginx重新整理——————http 模块中的请求过程[十一]

    前言 简单介绍一下http的一些指令. 正文 一般http的嵌套规则是这样的: http{ upstream{} split_clients {} map{} gep{} server{ if(){} ...

  7. Pytorch-均方差损失函数和交叉熵损失函数

    均方差损失函数mse_loss()与交叉熵损失函数cross_entropy() 1.均方差损失函数mse_loss() 均方差损失函数是预测数据和原始数据对应点误差的平方和的均值. \[MSE=\f ...

  8. szfpga Lattice高速下载器HW-USBN-2B 常见问题解答

    .产品特点 1). 支持windows7,Windows10 操作系统,两个操作系统非常稳定不断线. 2). 支持JTAG 模式,速度快,最高30Mb/s,调试serdes core,不会像hw-us ...

  9. locust的 -T,--tags使用

    官网的TAG配置说明:-T [TAG [TAG ...]], --tags [TAG [TAG ...]]List of tags to include in the test, so only ta ...

  10. Qt 从 QTransform 逆向解出 Translate/Scale/Rotate(平移/缩放/旋转)分析

    QTransform 用于图形绘制,它定义了如何平移(translate).缩放(scale).切变(shear).旋转(rotate)或投射(project)坐标系.注意:QTransform 是作 ...