Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
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-02-01 15:11:22 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8b11ab3f17afea82dc87cfc16c007e27fb631094
8b11ab3f
1 parent
c5b3367c
fix 样式调整
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
51 deletions
src/components/CheckboxField/index.vue
src/components/RadioField/index.vue
src/components/CheckboxField/index.vue
View file @
8b11ab3
<!--
* @Date: 2022-08-30 11:34:19
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-02-01 1
0:32:38
* @LastEditTime: 2023-02-01 1
5:10:11
* @FilePath: /data-table/src/components/CheckboxField/index.vue
* @Description: 多项选择控件
-->
...
...
@@ -17,32 +17,14 @@
<div v-if="item.component_props.note" class="note" v-html="item.component_props.note" />
<van-field :rules="item.rules" :border="false">
<template #input>
<van-checkbox-group
v-model="checkbox_value"
:direction="item.component_props.direction"
:max="item.component_props.max"
style="width: 100%"
>
<van-checkbox-group v-model="checkbox_value" :direction="item.component_props.direction"
:max="item.component_props.max" style="width: 100%">
<template v-for="x in item.component_props.options" :key="x.title">
<van-checkbox
@click="onClick(x)"
:name="x.title"
icon-size="1rem"
shape="square"
:checked-color="themeVars.radioColor"
style="margin-bottom: 0.25rem"
>{{ x.title }}</van-checkbox
>
<van-field
v-if="checkbox_value.includes(x.value) && x.is_input"
@blur="onBlur(x)"
v-model="x.affix"
label=""
:placeholder="x.input_placeholder"
:rules="x.input_required ? rules : ''"
:required="x.input_required"
style="border: 1px solid #eaeaea;border-radius: 0.25rem; padding: 0.25rem 0.5rem; margin-bottom: 0.25rem;"
/>
<van-checkbox @click="onClick(x)" :name="x.title" icon-size="1rem" shape="square"
:checked-color="themeVars.radioColor" style="margin-bottom: 0.25rem">{{ x.title }}</van-checkbox>
<van-field v-if="checkbox_value.includes(x.value) && x.is_input" @blur="onBlur(x)" v-model="x.affix"
label="" :placeholder="x.input_placeholder" :rules="x.input_required ? rules : ''"
:required="x.input_required" class="affix-input" />
</template>
</van-checkbox-group>
</template>
...
...
@@ -123,6 +105,7 @@ onMounted(() => {
font-size: 0.9rem;
font-weight: bold;
}
.note {
font-size: 0.9rem;
margin-left: 1rem;
...
...
@@ -130,6 +113,13 @@ onMounted(() => {
padding-bottom: 0.5rem;
white-space: pre;
}
.affix-input {
border: 1px solid #eaeaea;
border-radius: 0.25rem;
padding: 0.25rem 0.5rem;
margin-bottom: 0.25rem;
}
}
:deep(.van-checkbox) {
...
...
src/components/RadioField/index.vue
View file @
8b11ab3
<!--
* @Date: 2022-08-30 11:34:19
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-02-01 1
4:59:25
* @LastEditTime: 2023-02-01 1
5:10:41
* @FilePath: /data-table/src/components/RadioField/index.vue
* @Description: 单项选择控件
-->
<template>
<div v-if="HideShow" class="radio-field-page">
<div class="label">
{{ item.component_props.label
{{
item.component_props.label
}}<span v-if="item.component_props.required"> *</span>
</div>
<div v-if="item.component_props.note" class="note" v-html="item.component_props.note" />
<van-field :rules="item.rules">
<template #input>
<van-radio-group
@change="onChange(item)"
v-model="radio_value"
:direction="item.component_props.direction"
style="width: 100%"
>
<van-radio-group @change="onChange(item)" v-model="radio_value" :direction="item.component_props.direction"
style="width: 100%">
<template v-for="x in item.component_props.options" :key="x.value">
<van-radio
:name="x.value"
icon-size="1rem"
:checked-color="themeVars.radioColor"
style="margin-bottom: 0.25rem"
>{{ x.title }}</van-radio
>
<van-field
v-if="radio_value === x.value && x.is_input"
@blur="onBlur(x)"
v-model="x.affix"
label=""
:placeholder="x.input_placeholder"
:rules="x.input_required ? rules : ''"
:required="x.input_required"
style="border: 1px solid #eaeaea;border-radius: 0.25rem; padding: 0.25rem 0.5rem; margin-bottom: 0.25rem;"
/>
<van-radio :name="x.value" icon-size="1rem" :checked-color="themeVars.radioColor"
style="margin-bottom: 0.25rem">{{ x.title }}</van-radio>
<van-field v-if="radio_value === x.value && x.is_input" @blur="onBlur(x)" v-model="x.affix" label=""
:placeholder="x.input_placeholder" :rules="x.input_required ? rules : ''" :required="x.input_required"
class="affix-input" />
</template>
</van-radio-group>
</template>
...
...
@@ -114,10 +99,12 @@ onMounted(() => {
padding: 1rem 1rem 0 1rem;
font-size: 0.9rem;
font-weight: bold;
span {
color: red;
}
}
.note {
font-size: 0.9rem;
margin-left: 1rem;
...
...
@@ -125,6 +112,13 @@ onMounted(() => {
padding-bottom: 0.5rem;
white-space: pre;
}
.affix-input {
border: 1px solid #eaeaea;
border-radius: 0.25rem;
padding: 0.25rem 0.5rem;
margin-bottom: 0.25rem;
}
}
:deep(.van-radio) {
...
...
Please
register
or
login
to post a comment