Y
Y
Yeldos Adetbekov2017-06-12 22:47:04
JavaScript
Yeldos Adetbekov, 2017-06-12 22:47:04

How to disable scripts and styles when moving from one component (Route) to another?

Hello comrades, I need help!
I am using Vue-router. Everything works fine, but there is a big BUT. When switching to another url (route), the influence of all styles and scripts from the previous component remains active. How to put them out so that when you return, re-render everything again (I removed keep-alive, but still third-party scripts do not stop affecting the current state).
For example, on the main page I use pagepiling.js (Beautiful "sticky" vertical slider with navigation dots). When initialized, it creates some extra scripts and styles in the head and creates a div#pp-nav outside the container. How to remove everything that was going on in the first component when switching to another component?
Thanks in advance !)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kulakov, 2017-06-12
@kulakoff Vue.js

Vue is not responsible for your slider, so it is unlikely that it will be able to do something with its tools. As an option, check what this slider creates and overwrite these elements with handles. Either use more specific styles for your components, or create styles that won't overlap.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question