Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修正L7Plot官网图表示例按钮跳转链接 #2233

Merged
merged 4 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/component/src/control/layerSwitch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default class LayerSwitch extends SelectControl<ILayerSwitchOption> {
super.setOptions(option);
if (isLayerChange) {
if (this.controlOption.multiple === false) {
this.handleSingleSelectionMode();
this.handleSingleSelection();
}
this.selectValue = this.getLayerVisible();
this.controlOption.options = this.getLayerOptions();
Expand All @@ -119,15 +119,15 @@ export default class LayerSwitch extends SelectControl<ILayerSwitchOption> {

// TODO: 单选模式下,目前默认展示第一项,通过用户提供defaultValue展示默认选项的属性待开发
// 如果是单选模式,则只显示第一个图层
private handleSingleSelectionMode() {
private handleSingleSelection() {
this.layers.forEach((layer, index) => {
index === 0 ? layer.show() : layer.hide();
});
}

public onAdd(): HTMLElement {
if (this.controlOption.multiple === false) {
this.handleSingleSelectionMode()
this.handleSingleSelection()
}

if (!this.controlOption.options?.length) {
Expand Down
2 changes: 1 addition & 1 deletion packages/site/site/pages/index.zh.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const IndexPage = () => {
const bannerButtons = [
{
text: t('图表示例'),
link: `/${i18n.language}/examples/gallery`,
link: `/${i18n.language}/examples`,
type: 'primary',
},
{
Expand Down
Loading