
ant design vue
爬坑之旅
gyuei
专栏内容均为个人笔记
展开
-
table表格customRender的使用
1. 使用customRender引入插槽 scopedSlots: { customRender: 'action' }2. 使用customRender指定渲染内容columns: [ { title: '类型', dataIndex: 'type', customRender: text => { if (text === 0) { return '客户1' } else if (text ==原创 2020-12-22 11:49:46 · 30598 阅读 · 5 评论 -
antdv之全局配置国际化文案
由于版本更新,<a-locale-provider>标签需要换成<a-config-provider>标签( App.vue文件 )<template> <a-locale-provider :locale="locale"> <App /> </a-locale-provider></template><script> import zhCN from 'ant-design-vue原创 2020-12-03 22:04:14 · 1545 阅读 · 0 评论 -
table表格设置日期换行
需求:每个日期占据单独一行后台返回的数据格式html部分代码<div slot="payDate" slot-scope="text"> <div v-for="item in text" :key="item"> <span>{{ item }}</span><br> </div></div>js部分代码如下// table标题设置columns: [ { ti原创 2020-11-25 17:22:15 · 535 阅读 · 0 评论 -
Affix 固钉的使用
需求:当内容区域比较长,需要滚动页面时,操作按钮需要在滚动范围内始终展现代码如下:<a-affix :offsetTop="50" :style="{ position: 'absolute', top: '15px', left: 0, width: '98%', 'text-align': 'right'}"> <a-button><router-link :to="{ name: 'CheckIn' }">取消</router-link></原创 2020-11-25 16:50:06 · 1928 阅读 · 0 评论 -
antdv之实现checkbox-group默认全选
需求:checkbox-group默认全部选中html部分如下:<a-checkbox-group v-model="formPopover.checkedList" @change="onChangeChecked"> <a-row :gutter="[16, 16]" style="width:540px;"> <a-col :span="12" v-for="item in checkboxTitle" :key="item.dataIndex">原创 2020-11-10 11:04:12 · 6883 阅读 · 6 评论 -
antdv实现图片的上传、预览以及删除功能
需求:1.实现图片的上传和预览功能2.图片不能超过规定的张数3.预览时,图片可以进行上一张和下一张的切换html部分代码<a-button type="primary" ghost size="small" class="margin-right10" @click="pictureSend(record, index)">上传图片</a-button><a-button type="primary" si原创 2020-11-02 18:29:14 · 7194 阅读 · 3 评论 -
antdv之指定input框内容大写
html部分<template> <keep-alive> <router-view v-if="$route.meta.subPage" /> <a-row> <a-col :span="24"> <a-form-model ref="form" :model="formTab" layout="inline"> <a-row :gutter="10">原创 2020-11-02 18:03:19 · 919 阅读 · 0 评论 -
antdv之使用customRow属性实现table当前点击行高亮
需求:点击table时,给当前点击行加背景色使其高亮显示参考网址:https://blog.youkuaiyun.com/EasonGG/article/details/105687765html部分代码:<a-table:columns=“columns1”:data-source=“exitData”:customRow=“exitCustomRow”size=“middle”```js部分代码:data() { return { customKey: ''原创 2020-10-16 17:03:40 · 4546 阅读 · 9 评论 -
多个table表格与model框结合实现数据的增加和修改
需求:1.进入页面加载table表格数据2.点击编辑按钮,弹出相应编辑内容的model框;model框的内容要与table选中行的内容一致,作出修改后,table的内容要相应变化3.点击增加按钮,弹出增加相应内容的model框4.点击model框的保存按钮,判断当前是修改内容的保存还是新增内容的保存5.点击作废按钮,删除当前整行内容html部分代码如下:<template> <keep-alive> <router-view v-if="$route.原创 2020-09-30 17:23:35 · 576 阅读 · 0 评论 -
antdv之select下拉选择框
需求:1.select框的内容默认为空2.选中下拉框中的数值后,select框的内容等于选中的值html部分代码如下:<a-form-model ref="ruleForm" :model="formModel" :rules="rules" :label-col="labelCol" :wrapper-col="wrapperCol"> <a-form-model-item label="箱型箱类" prop="containerType"> <a-select原创 2020-09-30 16:42:43 · 3943 阅读 · 0 评论 -
多组radio-group的实现
1.实现两组互斥的radio-group框2.radio-group框中的radio按钮需要循环得到html部分如下所示:<a-form-model-item label="区位号"> <a-input placeholder="区号" style="width:48%;margin-right:4%;" v-model="oldAreaValue" /></a-form-model-item><!-----第一个radio-group框--->原创 2020-09-23 17:53:47 · 2760 阅读 · 0 评论 -
table表格与model框结合实现数据的增加和修改
<template> <keep-alive> <router-view v-if="$route.meta.subPage" /> <a-row :gutter="[16, 16]"> <a-col :span="24"> <a-card title="结果" :bordered="false"> <div slot="extra">原创 2020-09-11 10:49:22 · 1599 阅读 · 0 评论 -
js之两个字符串日期相减得出天数
需求:1.计算出完成任务需要的天数,结果不能为02.如果当天能完成,则完成任务需要1天3.如果第二胎能完成,则完成任务需要2天以此类推html部分代码如下:<a-form-model :model="form" :rules="rules" :label-col="labelCol" :wrapper-col="wrapperCol"> <a-form-model-item label="计划开始时间" prop="planStartTime"> <a-da原创 2020-09-08 16:34:45 · 635 阅读 · 0 评论 -
table表格数据渲染
需求:打开页面时,加载table表格数据html部分代码如下:<a-table :row-selection="rowSelection" :columns="columns" :data-source="data"> <div slot="operator" slot-scope="text">{{ text.content1 }}</div> <div slot="billNo" slot-scope="text">{{ text.content2原创 2020-09-08 14:42:02 · 2785 阅读 · 0 评论 -
点击事件实现v-for模块的增加、删除
<a-button type="primary" ghost @click="addItem" size="small">增加</a-button><a-row :gutter="[16, 16]" v-for="(list, otherIndex) inlists" :key="otherIndex"> <a-col :span="5"> <a-input v-model.trim="form.entrancePlanList[plan原创 2020-09-07 17:00:35 · 596 阅读 · 0 评论 -
table表格checked选中操作
需求:1.table表格有多条数据,需要实现表格选中/取消选中的功能2.选中表格时每次只能选其中的一条数据html部分<template> <div> <a-table :columns="columns" :data-source="data"> <span slot="action" slot-scope="text, record"> <a-checkbox @change="onChange(record)" :ch原创 2020-09-04 16:36:17 · 1576 阅读 · 0 评论 -
inputNumber设置必填项
设置input必填项时,写法如下:<a-form-model :model="form" :rules="rules"> <a-form-model-item label="Instant delivery" prop="desc"> <a-input v-model="form.desc" /> </a-form-model-item></a-form-model>export default { data() { ret原创 2020-09-03 17:27:12 · 4304 阅读 · 0 评论