Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
custom_form
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2023-04-13 16:24:50 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1150c9420123821bc0728253220f0913641ebfaf
1150c942
1 parent
987bce32
✨ feat(便签控件): 样式和功能调整
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
src/components/NoteField/index.vue
src/hooks/useComponentType.js
src/components/NoteField/index.vue
View file @
1150c94
<!--
* @Date: 2022-08-29 14:31:20
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-0
3-08 15:28:3
3
* @FilePath: /
data-table
/src/components/NoteField/index.vue
* @LastEditTime: 2023-0
4-13 16:09:0
3
* @FilePath: /
custom_form
/src/components/NoteField/index.vue
* @Description: 富文本组件
-->
<template>
<div v-if="HideShow" class="note-field-page">
<div class="label">
<
span v-if="item.component_props.required" class="required"> *</span
>
<
span v-if="!item.component_props.hide_label">{{ item.component_props.label }}</span
>
<
text v-if="item.component_props.required" class="required"> *</text
>
<
text v-if="!item.component_props.hide_label">{{ item.component_props.label }}</text
>
</div>
<div class="html" style="padding: 0
.5rem 1rem 0 1rem
;" v-html="item.component_props.note"></div>
<div class="html" style="padding: 0
1rem; font-size: 16px
;" v-html="item.component_props.note"></div>
</div>
</template>
<script setup>
import { ref, computed, watch, onMounted, reactive } from "vue";
const props = defineProps({
item: Object,
});
...
...
@@ -28,11 +30,12 @@ const HideShow = computed(() => {
<style lang="less">
.note-field-page {
.label {
padding: 1rem 1rem 0 1rem;
font-size: 0.9rem;
margin-left: 1rem;
padding-bottom: 20px;
font-size: 26px;
font-weight: bold;
span
.required {
text
.required {
color: red;
}
}
...
...
src/hooks/useComponentType.js
View file @
1150c94
...
...
@@ -25,7 +25,7 @@ import NumberField from '@/components/NumberField/index.vue'
// import RuleField from '@/components/RuleField/index.vue'
import
MultiRuleField
from
'@/components/MultiRuleField/index.vue'
// import ButtonField from '@/components/ButtonField/index.vue'
//
import NoteField from '@/components/NoteField/index.vue'
import
NoteField
from
'@/components/NoteField/index.vue'
// import NameField from '@/components/NameField/index.vue'
// import GenderField from '@/components/GenderField/index.vue'
...
...
@@ -168,10 +168,10 @@ export function createComponentType(data) {
item
.
value
=
[]
item
.
component
=
MultiRuleField
}
//
if (item.component_props.tag === 'note') {
//
item.name = item.key
//
item.component = NoteField
//
}
if
(
item
.
component_props
.
tag
===
'note'
)
{
item
.
name
=
item
.
key
item
.
component
=
NoteField
}
// if (item.component_props.tag === 'name') {
// item.name = item.key
// item.component = NameField
...
...
Please
register
or
login
to post a comment