feat: use remove replace hidden

This commit is contained in:
F-loat
2020-01-06 17:05:36 +08:00
parent a07ae83ade
commit 8aae90db2b
2 changed files with 8 additions and 4 deletions
@@ -11,6 +11,7 @@
<div v-for="(fieldSchema, field) in filteredPropreties"
:key="field"
:class="['el-col-' + (fieldSchema.ui.columns * 2 || 24)]"
:style="{display: _analyzeVal(fieldSchema.ui.hidden) ? 'none' : ''}"
class="el-col el-form-item">
<template>
@@ -43,6 +44,7 @@
<div v-for="(fieldSchema, field) in filteredPropreties"
:key="field"
:class="['el-col-' + (fieldSchema.ui.columns * 2 || 24)]"
:style="{display: _analyzeVal(fieldSchema.ui.hidden) ? 'none' : ''}"
class="el-col el-form-item">
<template>
<label v-if="!fieldSchema.ui.noLabelSpace" :style="{'visibility': fieldSchema.ui.showLabel ? 'visible' : 'hidden', width: mergeConfig.labelWidth}" class="el-form-item__label">
@@ -175,9 +177,9 @@ export default {
const { properties } = this.schema
return Object.keys(properties).reduce((result, curkey) => {
const curval = properties[curkey]
const hidden = this._analyzeVal(curval.ui.hidden)
const remove = this._analyzeVal(curval.ui.remove)
if (!hidden) {
if (!remove) {
result[curkey] = curval
}
@@ -7,6 +7,7 @@
<div v-for="(fieldSchema, field) in filteredPropreties"
:key="field"
:class="['col-md-' + (fieldSchema.ui.columns || 12)]"
:style="{display: _analyzeVal(fieldSchema.ui.hidden) ? 'none' : ''}"
class="form-group">
<template>
<label v-if="!legendEnable(fieldSchema) && !fieldSchema.ui.noLabelSpace" :style="{'visibility': fieldSchema.ui.showLabel ? 'visible' : 'hidden'}">
@@ -34,6 +35,7 @@
<div v-for="(fieldSchema, field) in filteredPropreties"
:key="field"
:class="['col-md-' + (fieldSchema.ui.columns || 12)]"
:style="{display: _analyzeVal(fieldSchema.ui.hidden) ? 'none' : ''}"
class="form-group row">
<template>
<label v-if="!legendEnable(fieldSchema) && !fieldSchema.ui.noLabelSpace" :style="{'visibility': fieldSchema.ui.showLabel ? 'visible' : 'hidden', width: mergeConfig.labelWidth}" class="col-form-label">
@@ -110,9 +112,9 @@
const { properties } = this.schema
return Object.keys(properties).reduce((result, curkey) => {
const curval = properties[curkey]
const hidden = this._analyzeVal(curval.ui.hidden)
const remove = this._analyzeVal(curval.ui.remove)
if (!hidden) {
if (!remove) {
result[curkey] = curval
}