Treat all links as external by default

Hi all,

How can I configure Framework7 such that all anchors (<a>) are not processed by routes but just open the specified link? If have tried setting views.router = false, but even with this setting the default event handler is blocked. Also, setting this parameter breaks GUI elements like the “stepper” element.

So is there a way to define a default route that will make all anchor tags work in their old fashion? Right now I have added class “external” everywhere, but this is rather cumbersome.

Cheers,
Bart

$$(‘a’).forEach(function (e) { $$(e).addClass(‘external’); });

1 Like
app = new Framework7({
  ...
  clicks: {
    externalLinks: ‘a’,
  },
  view: {
    router: false,
  },
})

Thanks! Simple, didn’t think of that.

Thanks! Will try this as well!