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
2022-11-22 14:26:50 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
eacf3531fa8bf26629edd998c0df6132a9eb030c
eacf3531
1 parent
09afb49c
✨ feat: 新增分割线组件
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
3 deletions
src/components/DividerField/index.vue
src/hooks/useComponentType.js
src/main.js
src/components/DividerField/index.vue
0 → 100644
View file @
eacf353
<!--
* @Date: 2022-08-29 14:31:20
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-11-22 14:23:49
* @FilePath: /data-table/src/components/DividerField/index.vue
* @Description: 分隔线组件
-->
<template>
<div class="divider-field-page">
<van-divider :style="styleObj">
{{ item.component_props.content }}
</van-divider>
</div>
</template>
<script setup>
const props = defineProps({
item: Object,
});
const styleObj = ref({});
onMounted(() => {
styleObj.value = {
color: props.item.component_props.color,
borderColor: props.item.component_props.color,
padding: props.item.component_props.padding,
};
});
</script>
<style lang="less" scoped>
.divider-field-page {
}
</style>
src/hooks/useComponentType.js
View file @
eacf353
...
...
@@ -18,6 +18,7 @@ import CalendarField from '@/components/CalendarField/index.vue'
import
IdentityField
from
'@/components/IdentityField/index.vue'
import
NumberField
from
'@/components/NumberField/index.vue'
import
DesField
from
'@/components/DesField/index.vue'
import
DividerField
from
'@/components/DividerField/index.vue'
/**
* 生成自定义组件类型
...
...
@@ -114,5 +115,9 @@ export function createComponentType(data) {
item
.
name
=
item
.
key
;
item
.
component
=
DesField
;
}
if
(
item
.
component_props
.
name
===
'divider'
)
{
item
.
name
=
item
.
key
;
item
.
component
=
DividerField
;
}
})
}
...
...
src/main.js
View file @
eacf353
...
...
@@ -2,12 +2,12 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-31 12:06:19
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-
09-14 11:05:31
* @LastEditTime: 2022-
11-22 14:12:00
* @FilePath: /data-table/src/main.js
* @Description:
*/
import
{
createApp
}
from
'vue'
;
import
{
Button
,
Image
as
VanImage
,
Col
,
Row
,
Icon
,
Form
,
Field
,
CellGroup
,
ConfigProvider
,
Toast
,
Uploader
,
Empty
,
Tab
,
Tabs
,
Overlay
,
NumberKeyboard
,
Lazyload
,
List
,
PullRefresh
,
Popup
,
Picker
,
Sticky
,
Stepper
,
Tag
,
Swipe
,
SwipeItem
,
Dialog
,
ActionSheet
,
Loading
,
Checkbox
,
Search
,
NavBar
,
Collapse
,
CollapseItem
,
RadioGroup
,
Radio
,
CheckboxGroup
,
Area
,
DatePicker
,
TimePicker
,
PickerGroup
,
Rate
,
Calendar
}
from
'vant'
;
import
{
Button
,
Image
as
VanImage
,
Col
,
Row
,
Icon
,
Form
,
Field
,
CellGroup
,
ConfigProvider
,
Toast
,
Uploader
,
Empty
,
Tab
,
Tabs
,
Overlay
,
NumberKeyboard
,
Lazyload
,
List
,
PullRefresh
,
Popup
,
Picker
,
Sticky
,
Stepper
,
Tag
,
Swipe
,
SwipeItem
,
Dialog
,
ActionSheet
,
Loading
,
Checkbox
,
Search
,
NavBar
,
Collapse
,
CollapseItem
,
RadioGroup
,
Radio
,
CheckboxGroup
,
Area
,
DatePicker
,
TimePicker
,
PickerGroup
,
Rate
,
Calendar
,
Divider
}
from
'vant'
;
import
router
from
'./router'
;
import
App
from
'./App.vue'
;
// import axios from './utils/axios';
...
...
@@ -25,6 +25,6 @@ app.config.warnHandler = () => null;
app
.
config
.
globalProperties
.
$http
=
axios
;
// 关键语句
app
.
use
(
pinia
).
use
(
router
).
use
(
Button
).
use
(
VanImage
).
use
(
Col
).
use
(
Row
).
use
(
Icon
).
use
(
Form
).
use
(
Field
).
use
(
CellGroup
).
use
(
Toast
).
use
(
Uploader
).
use
(
Empty
).
use
(
Tab
).
use
(
Tabs
).
use
(
Overlay
).
use
(
NumberKeyboard
).
use
(
Lazyload
).
use
(
List
).
use
(
PullRefresh
).
use
(
Popup
).
use
(
Picker
).
use
(
Sticky
).
use
(
Stepper
).
use
(
Tag
).
use
(
Swipe
).
use
(
SwipeItem
).
use
(
Dialog
).
use
(
ActionSheet
).
use
(
Loading
).
use
(
Checkbox
).
use
(
Search
).
use
(
ConfigProvider
).
use
(
NavBar
).
use
(
Collapse
).
use
(
CollapseItem
).
use
(
Radio
).
use
(
RadioGroup
).
use
(
CheckboxGroup
).
use
(
Area
).
use
(
DatePicker
).
use
(
TimePicker
).
use
(
PickerGroup
).
use
(
Rate
).
use
(
Calendar
);
app
.
use
(
pinia
).
use
(
router
).
use
(
Button
).
use
(
VanImage
).
use
(
Col
).
use
(
Row
).
use
(
Icon
).
use
(
Form
).
use
(
Field
).
use
(
CellGroup
).
use
(
Toast
).
use
(
Uploader
).
use
(
Empty
).
use
(
Tab
).
use
(
Tabs
).
use
(
Overlay
).
use
(
NumberKeyboard
).
use
(
Lazyload
).
use
(
List
).
use
(
PullRefresh
).
use
(
Popup
).
use
(
Picker
).
use
(
Sticky
).
use
(
Stepper
).
use
(
Tag
).
use
(
Swipe
).
use
(
SwipeItem
).
use
(
Dialog
).
use
(
ActionSheet
).
use
(
Loading
).
use
(
Checkbox
).
use
(
Search
).
use
(
ConfigProvider
).
use
(
NavBar
).
use
(
Collapse
).
use
(
CollapseItem
).
use
(
Radio
).
use
(
RadioGroup
).
use
(
CheckboxGroup
).
use
(
Area
).
use
(
DatePicker
).
use
(
TimePicker
).
use
(
PickerGroup
).
use
(
Rate
).
use
(
Calendar
)
.
use
(
Divider
)
;
app
.
use
(
vueEsign
)
app
.
mount
(
'#app'
);
...
...
Please
register
or
login
to post a comment