Commit a3f3dc15 authored by 高天阳's avatar 高天阳

面板插槽使用

parent 7ceba1ae
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
* 在面板页传入面板宽度 * 在面板页传入面板宽度
*/ */
hmCollapse: { hmCollapse: {
type: String, type: Number,
required: false required: false
}, },
showFields: { showFields: {
......
...@@ -2,9 +2,13 @@ ...@@ -2,9 +2,13 @@
<div> <div>
<hm-panel :schema="schema['HmUser']" :hmTitle="titleBak" :hmContentClass="hmContentClass" <hm-panel :schema="schema['HmUser']" :hmTitle="titleBak" :hmContentClass="hmContentClass"
:hmStyle="styleBak" :hmPanelHeight="panelHeightBak" :hmCollapse="collapseBak"> :hmStyle="styleBak" :hmPanelHeight="panelHeightBak" :hmCollapse="collapseBak">
<hm-complex-detail :schema="schema['HmUser']" :tableId="userId">
</hm-complex-detail>
</hm-panel> </hm-panel>
<hm-panel :schema="schema['HmUser']" :hmTitle="hmTitle" :hmTitleClass="hmTitleClass" <hm-panel :schema="schema['HmUser']" :hmTitle="hmTitle" :hmTitleClass="hmTitleClass"
:hmContentText="hmContentText" :hmStyle="hmStyle" :hmPanelHeight="hmPanelHeight" :hmCollapse="collapses"> :hmContentText="hmContentText" :hmStyle="hmStyle" :hmPanelHeight="hmPanelHeight" :hmCollapse="collapses">
<hm-complex-form :schema="schema['HmUser']" :fields="showFields">
</hm-complex-form>
</hm-panel> </hm-panel>
</div> </div>
</template> </template>
...@@ -13,6 +17,7 @@ ...@@ -13,6 +17,7 @@
import HmPanel from './HmPanel.vue' import HmPanel from './HmPanel.vue'
import schema from '../../schemas/hm_org_schema' import schema from '../../schemas/hm_org_schema'
import HmComplexDetail from '../details/HmComplexDetail.vue' import HmComplexDetail from '../details/HmComplexDetail.vue'
import HmComplexForm from '../forms/HmComplexForm.vue'
export default { export default {
name: 'HmPanel', name: 'HmPanel',
...@@ -21,7 +26,8 @@ ...@@ -21,7 +26,8 @@
// 使用其它组件 // 使用其它组件
components: { components: {
'hm-panel': HmPanel, 'hm-panel': HmPanel,
'hm-complex-detail': HmComplexDetail 'hm-complex-detail': HmComplexDetail,
'hm-complex-form': HmComplexForm
}, },
data() { data() {
return { return {
...@@ -41,14 +47,14 @@ ...@@ -41,14 +47,14 @@
this.hmContentClass = 'center' this.hmContentClass = 'center'
this.hmContentText = '面板文字' this.hmContentText = '面板文字'
this.hmStyle = { this.hmStyle = {
width: '50%', width: '80%',
background: '#42b983', background: '#42b983',
margin: '0 auto' margin: '0 auto'
} }
this.hmPanelHeight = { this.hmPanelHeight = {
height: '100px' height: '400px'
} }
this.collapses = 12 this.collapses = 22
this.showFields = ['username', 'loginid', 'password', 'mobile', 'email'] this.showFields = ['username', 'loginid', 'password', 'mobile', 'email']
this.showFields2 = ['mobile', 'loginid'] this.showFields2 = ['mobile', 'loginid']
this.titleBak = '测试面板' this.titleBak = '测试面板'
...@@ -58,7 +64,7 @@ ...@@ -58,7 +64,7 @@
marginBottom: '20px' marginBottom: '20px'
} }
this.panelHeightBak = { this.panelHeightBak = {
height: '200px' height: '500px'
} }
this.collapseBak = 22 this.collapseBak = 22
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment