egoist / vue-router-prefetch

Prefetch links when they are visible in viewport.
MIT License
384 stars 17 forks source link

Single File Components Use #52

Open MichaelPrecel opened 3 years ago

MichaelPrecel commented 3 years ago

Hi @egoist — thanks for your contributions to the Vue community <3

I'm just wondering whether this works with an app using Single File Components (with Vite)?

I've installed, however am running into the error:

[Vue warn]: Component is missing template or render function. 
  at <QuickLink to="/about" > 
  at <Menu> 
  at <App>

and

index.esm.js:181 Uncaught TypeError: Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'Element'.

Keen to hear your thoughts!

nicolas-t commented 2 years ago

Hello,

I faced the same issue with vue 3, be sure tu use yarn add vue-router-prefetch@^2. I simply ran yarn add vue-router-prefetch and it installed vue-router-prefetch@1.6.3

VincentDauliac commented 2 years ago

I'm using vue-router-prefetch@^2 and Vue 3, but getting the same error when using the "custom" prop on router-link components.

NamesMT commented 1 year ago

+1, using @^2 (2.0.2), getting: Uncaught TypeError: Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'Element'. at Proxy.observe (index.esm.js:181:18)

I also mostly uses router-link with custom prop.

samueleiche commented 1 year ago

I'm also using v2.0.2 and getting Uncaught TypeError: Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'Element'.

this.$el resolves differently in Vue 3, maybe the author is not aware. image