mirror of
https://github.com/vform666/variant-form3-vite.git
synced 2025-01-11 00:29:13 +08:00
grid-item组件改名为vf-grid-item,以解决与VueLayoutGrid组件冲突的问题。
This commit is contained in:
parent
7982a55ac4
commit
38af2fd516
@ -4,7 +4,7 @@
|
|||||||
<template v-if="!!widget.widgetList && (widget.widgetList.length > 0)">
|
<template v-if="!!widget.widgetList && (widget.widgetList.length > 0)">
|
||||||
<template v-for="(subWidget, swIdx) in widget.widgetList">
|
<template v-for="(subWidget, swIdx) in widget.widgetList">
|
||||||
<template v-if="'container' === subWidget.category">
|
<template v-if="'container' === subWidget.category">
|
||||||
<component :is="subWidget.type + '-item'" :widget="subWidget" :key="swIdx" :parent-list="widget.widgetList"
|
<component :is="getComponentByContainer(subWidget)" :widget="subWidget" :key="swIdx" :parent-list="widget.widgetList"
|
||||||
:index-of-parent-list="swIdx" :parent-widget="widget">
|
:index-of-parent-list="swIdx" :parent-widget="widget">
|
||||||
<!-- 递归传递插槽!!! -->
|
<!-- 递归传递插槽!!! -->
|
||||||
<template v-for="slot in Object.keys($slots)" v-slot:[slot]="scope">
|
<template v-for="slot in Object.keys($slots)" v-slot:[slot]="scope">
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
import containerItemMixin from "./containerItemMixin"
|
import containerItemMixin from "./containerItemMixin"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "grid-item",
|
name: "vf-grid-item", //grid-item跟VueGridLayout全局注册组件重名,故特殊处理!!
|
||||||
componentName: 'ContainerItem',
|
componentName: 'ContainerItem',
|
||||||
mixins: [emitter, i18n, refMixin, containerItemMixin],
|
mixins: [emitter, i18n, refMixin, containerItemMixin],
|
||||||
components: {
|
components: {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
:disabled="tab.options.disabled" :name="tab.options.name">
|
:disabled="tab.options.disabled" :name="tab.options.name">
|
||||||
<template v-for="(subWidget, swIdx) in tab.widgetList">
|
<template v-for="(subWidget, swIdx) in tab.widgetList">
|
||||||
<template v-if="'container' === subWidget.category">
|
<template v-if="'container' === subWidget.category">
|
||||||
<component :is="subWidget.type + '-item'" :widget="subWidget" :key="swIdx" :parent-list="tab.widgetList"
|
<component :is="getComponentByContainer(subWidget)" :widget="subWidget" :key="swIdx" :parent-list="tab.widgetList"
|
||||||
:index-of-parent-list="swIdx" :parent-widget="widget">
|
:index-of-parent-list="swIdx" :parent-widget="widget">
|
||||||
<!-- 递归传递插槽!!! -->
|
<!-- 递归传递插槽!!! -->
|
||||||
<template v-for="slot in Object.keys($slots)" v-slot:[slot]="scope">
|
<template v-for="slot in Object.keys($slots)" v-slot:[slot]="scope">
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
:style="{width: widget.options.cellWidth + ' !important' || '', height: widget.options.cellHeight + ' !important' || ''}">
|
:style="{width: widget.options.cellWidth + ' !important' || '', height: widget.options.cellHeight + ' !important' || ''}">
|
||||||
<template v-for="(subWidget, swIdx) in widget.widgetList">
|
<template v-for="(subWidget, swIdx) in widget.widgetList">
|
||||||
<template v-if="'container' === subWidget.category">
|
<template v-if="'container' === subWidget.category">
|
||||||
<component :is="subWidget.type + '-item'" :widget="subWidget" :key="swIdx" :parent-list="widget.widgetList"
|
<component :is="getComponentByContainer(subWidget)" :widget="subWidget" :key="swIdx" :parent-list="widget.widgetList"
|
||||||
:index-of-parent-list="swIdx" :parent-widget="widget">
|
:index-of-parent-list="swIdx" :parent-widget="widget">
|
||||||
<!-- 递归传递插槽!!! -->
|
<!-- 递归传递插槽!!! -->
|
||||||
<template v-for="slot in Object.keys($slots)" v-slot:[slot]="scope">
|
<template v-for="slot in Object.keys($slots)" v-slot:[slot]="scope">
|
||||||
|
@ -164,6 +164,10 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
getContainerWidgetName(widget) {
|
getContainerWidgetName(widget) {
|
||||||
|
if (widget.type === 'grid') { //grid-item跟VueGridLayout全局注册组件重名,故特殊处理!!
|
||||||
|
return 'vf-grid-item'
|
||||||
|
}
|
||||||
|
|
||||||
return widget.type + '-item'
|
return widget.type + '-item'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -18,5 +18,13 @@ export default {
|
|||||||
return this.refList['v_form_ref']
|
return this.refList['v_form_ref']
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getComponentByContainer(con) {
|
||||||
|
if (con.type === 'grid') { //grid-item跟VueGridLayout全局注册组件重名,故特殊处理!!
|
||||||
|
return 'vf-grid-item'
|
||||||
|
}
|
||||||
|
|
||||||
|
return con.type + '-item'
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
<template v-if="!!widget.widgetList && (widget.widgetList.length > 0)">
|
<template v-if="!!widget.widgetList && (widget.widgetList.length > 0)">
|
||||||
<template v-for="(subWidget, swIdx) in widget.widgetList">
|
<template v-for="(subWidget, swIdx) in widget.widgetList">
|
||||||
<template v-if="'container' === subWidget.category">
|
<template v-if="'container' === subWidget.category">
|
||||||
<component :is="subWidget.type + '-item'" :widget="subWidget" :key="swIdx" :parent-list="widget.widgetList"
|
<component :is="getComponentByContainer(subWidget)" :widget="subWidget" :key="swIdx" :parent-list="widget.widgetList"
|
||||||
:index-of-parent-list="swIdx" :parent-widget="widget">
|
:index-of-parent-list="swIdx" :parent-widget="widget">
|
||||||
<!-- 递归传递插槽!!! -->
|
<!-- 递归传递插槽!!! -->
|
||||||
<template v-for="slot in Object.keys($slots)" v-slot:[slot]="scope">
|
<template v-for="slot in Object.keys($slots)" v-slot:[slot]="scope">
|
||||||
|
Loading…
Reference in New Issue
Block a user