增加参数 showClose、增加插槽 prefix

This commit is contained in:
xuliangzhan
2021-04-24 11:36:54 +08:00
parent 5e96ca0bf3
commit 0dfe0d48e6
10 changed files with 57 additions and 13 deletions

View File

@@ -297,7 +297,26 @@ const apis = [
type: '',
enum: '',
defVal: '',
list: []
list: [
{
name: 'prefix',
desc: '前缀图标模板',
version: '',
type: '',
enum: '',
defVal: '',
list: []
},
{
name: 'suffix',
desc: '后缀图标模板',
version: '',
type: '',
enum: '',
defVal: '',
list: []
}
]
},
{
name: 'Events',

View File

@@ -206,6 +206,15 @@ const apis = [
defVal: 'false',
list: []
},
{
name: 'show-close',
desc: '是否显示关闭按钮',
version: '3.2.20',
type: 'Boolean',
enum: '',
defVal: 'true',
list: []
},
{
name: 'duration',
descKey: 'app.api.modal.desc.duration',

View File

@@ -178,7 +178,17 @@ const apis = [
type: '',
enum: '',
defVal: '',
list: []
list: [
{
name: 'prefix',
desc: '前缀图标模板',
version: '3.2.20',
type: '',
enum: '',
defVal: '',
list: []
}
]
},
{
name: 'Events',

View File

@@ -1,6 +1,6 @@
<template>
<div>
<p class="tip">单元格超出指定宽度自动换行通过设置 <table-api-link prop="scroll-x"/>="{enabled: false} 和 <table-api-link prop="scroll-y"/>="{enabled: false} 启用自动换行</p>
<p class="tip">单元格超出指定宽度自动换行通过设置 <table-api-link prop="scroll-x"/>="{enabled: false} 和 <table-api-link prop="scroll-y"/>="{enabled: false} 关闭虚拟滚动则支持自动换行</p>
<vxe-table
:data="tableData"

View File

@@ -1,6 +1,6 @@
{
"name": "vxe-table",
"version": "3.2.19",
"version": "3.2.20",
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟滚动、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、虚拟列表、模态窗口、自定义模板、渲染器、贼灵活的配置项、扩展接口等...",
"scripts": {
"serve": "vue-cli-service serve",
@@ -88,7 +88,7 @@
"vxe-table-plugin-virtual-tree": "0.6.7",
"xe-ajax": "^4.0.5",
"xe-clipboard": "^1.10.1",
"xe-utils": "^3.1.15",
"xe-utils": "^3.2.0",
"xlsx": "^0.16.8"
},
"peerDependencies": {

View File

@@ -45,7 +45,7 @@ function validErrorRuleValue (rule, val) {
}
// 如果存在 pattern正则校验
if (pattern) {
return (XEUtils.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)
return !(XEUtils.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)
}
return false
}

View File

@@ -35,6 +35,7 @@ export default {
showHeader: { type: Boolean, default: () => GlobalConfig.modal.showHeader },
showFooter: { type: Boolean, default: () => GlobalConfig.modal.showFooter },
showZoom: { type: Boolean, default: null },
showClose: { type: Boolean, default: () => GlobalConfig.modal.showClose },
dblclickZoom: { type: Boolean, default: () => GlobalConfig.modal.dblclickZoom },
width: [Number, String],
height: [Number, String],
@@ -114,7 +115,7 @@ export default {
}
},
render (h) {
const { $scopedSlots, slots = {}, inited, vSize, className, type, resize, showZoom, animat, loading, status, iconStatus, showFooter, zoomLocat, modalTop, dblclickZoom, contentVisible, visible, title, lockScroll, lockView, mask, isMsg, showTitleOverflow, destroyOnClose } = this
const { _e, $scopedSlots, slots = {}, inited, vSize, className, type, resize, showClose, showZoom, animat, loading, status, iconStatus, showFooter, zoomLocat, modalTop, dblclickZoom, contentVisible, visible, title, lockScroll, lockView, mask, isMsg, showTitleOverflow, destroyOnClose } = this
const content = this.content || this.message
const defaultSlot = $scopedSlots.default || slots.default
const footerSlot = $scopedSlots.footer || slots.footer
@@ -170,8 +171,8 @@ export default {
on: {
click: this.toggleZoomEvent
}
}) : null,
h('i', {
}) : _e(),
showClose ? h('i', {
class: ['vxe-modal--close-btn', 'trigger--btn', GlobalConfig.icon.MODAL_CLOSE],
attrs: {
title: GlobalConfig.i18n('vxe.modal.close')
@@ -179,7 +180,7 @@ export default {
on: {
click: this.closeEvent
}
})
}) : _e()
]) : null,
h('div', {
class: 'vxe-modal--body'

View File

@@ -325,7 +325,8 @@ export default {
GlobalEvent.off(this, 'blur')
},
render (h) {
const { vSize, className, inited, isActivated, disabled, visiblePanel } = this
const { $scopedSlots, vSize, className, inited, isActivated, disabled, visiblePanel } = this
const prefixSlot = $scopedSlots.prefix
return h('div', {
class: ['vxe-select', className ? (XEUtils.isFunction(className) ? className({ $select: this }) : className) : '', {
[`size--${vSize}`]: vSize,
@@ -356,7 +357,10 @@ export default {
focus: this.focusEvent,
blur: this.blurEvent,
'suffix-click': this.togglePanelEvent
}
},
scopedSlots: prefixSlot ? {
prefix: () => prefixSlot({})
} : {}
}),
h('div', {
ref: 'panel',

View File

@@ -304,6 +304,7 @@ export default {
dblclickZoom: true,
showTitleOverflow: true,
animat: true,
showClose: true,
// storage: false,
storageKey: 'VXE_MODAL_POSITION'
},

View File

@@ -47,7 +47,7 @@ function validErrorRuleValue (rule, val) {
}
// 如果存在 pattern正则校验
if (pattern) {
return (XEUtils.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)
return !(XEUtils.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)
}
return false
}