Skip to content

Commit 60eecbe

Browse files
committed
[example]优化属性面板示例
1 parent 55e4a48 commit 60eecbe

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

examples/component/components_attribute_panel_vue.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
height: 100%;
2222
}
2323

24-
.sm-component-table-popup__table.sm-component-table-wrapper .sm-component-table-content {
25-
max-height: 400px;
26-
padding: 10px;
27-
}
28-
2924
.panel-wrapper {
3025
background: #fff;
3126
box-shadow: -2px 0 8px rgb(0 0 0 / 15%);
@@ -50,7 +45,7 @@
5045
<sm-web-map server-url="https://iportal.supermap.io/iportal" map-id="801571284" @load="mapLoad">
5146
</sm-web-map>
5247
<div class="panel-wrapper">
53-
<sm-attribute-panel :attributes="attrbiutes" :columns="tableColumns">
48+
<sm-attribute-panel :attributes="attrbiutes" :columns="tableColumns" :title="panelTitle">
5449
</sm-attribute-panel>
5550
</div>
5651
</div>
@@ -60,13 +55,17 @@
6055
el: '#main',
6156
data() {
6257
return {
63-
attrbiutes: []
58+
attrbiutes: [],
59+
title: ''
6460
};
6561
},
6662
mounted() {
6763
this.$message.info(resources.msg_clickLayerToPopup);
6864
},
6965
computed: {
66+
panelTitle() {
67+
return this.title || resources.text_attributePanel
68+
},
7069
tableColumns() {
7170
return [{
7271
dataIndex: 'attribute'
@@ -89,6 +88,7 @@
8988
var features = vm.map.queryRenderedFeatures(bbox);
9089
if (features.length > 0) {
9190
var matchFature = features[0];
91+
vm.title = matchFature.layer.id;
9292
vm.attrbiutes = Object.keys(matchFature.properties).map(function (prop) {
9393
return {
9494
attribute: prop,
@@ -98,6 +98,7 @@
9898
vm.addHighlightLayer(matchFature);
9999
} else {
100100
vm.attrbiutes = [];
101+
vm.title = ''
101102
vm.removeHighlight();
102103
}
103104
});

0 commit comments

Comments
 (0)