mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 12:08:13 +08:00
commit
3070bf889f
@ -348,9 +348,13 @@ export default class Page extends React.Component<PageProps> {
|
||||
handleClick(e: any) {
|
||||
const target: HTMLElement = e.target as HTMLElement;
|
||||
const {env} = this.props;
|
||||
const link =
|
||||
target.tagName === 'A' && target.hasAttribute('data-link')
|
||||
? target.getAttribute('data-link')
|
||||
: target.closest('a[data-link]')?.getAttribute('data-link');
|
||||
|
||||
if (env && target.tagName === 'A' && target.hasAttribute('data-link')) {
|
||||
env.jumpTo(target.getAttribute('data-link') as string);
|
||||
if (env && link) {
|
||||
env.jumpTo(link);
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user