mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 06:19:51 +00:00
[Update] 添加help text
This commit is contained in:
@@ -6,6 +6,15 @@
|
||||
:rules="_show && Array.isArray(data.rules) ? data.rules : []"
|
||||
v-bind="data.attrs"
|
||||
>
|
||||
<template v-if="data.helpTips" #label>
|
||||
<el-tooltip placement="top">
|
||||
<div slot="content" v-html="data.helpTips" />
|
||||
<el-button style="padding: 0">
|
||||
<i class="fa fa-info-circle" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
{{ data.label }}
|
||||
</template>
|
||||
<template v-if="readonly && hasReadonlyContent">
|
||||
<div
|
||||
v-if="data.type === 'input'"
|
||||
@@ -55,6 +64,7 @@
|
||||
>{{ opt.label }}</el-radio>
|
||||
</template>
|
||||
</custom-component>
|
||||
<div v-if="data.helpText" class="help-block" v-html="data.helpText" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<script>
|
||||
|
@@ -2,7 +2,6 @@
|
||||
<el-form ref="elForm" v-bind="$attrs" :model="value" class="el-form-renderer">
|
||||
<template v-for="item in innerContent">
|
||||
<slot :name="`id:${item.id}`" />
|
||||
<slot :name="`$id:${item.id}`" />
|
||||
<component
|
||||
:is="item.type === GROUP ? 'render-form-group' : 'render-form-item'"
|
||||
:key="item.id"
|
||||
@@ -14,6 +13,7 @@
|
||||
:options="options[item.id]"
|
||||
@updateValue="updateValue"
|
||||
/>
|
||||
<slot :name="`$id:${item.id}`" />
|
||||
</template>
|
||||
<slot />
|
||||
</el-form>
|
||||
|
@@ -91,4 +91,16 @@ export default {
|
||||
.el-form /deep/ .form-group-header {
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
.el-form /deep/ .help-block {
|
||||
display: block;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 10px;
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
.el-form /deep/ .help-block a {
|
||||
color: #1c84c6;
|
||||
}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user