Vue component fires mounted() & created() twice on page reload but once when navigated to via a route2019 Community Moderator ElectionVue v-on:click does not work on componentVueJs 2.0 - how to listen for `props` changesWebpack fails to mount Vue componentsvue.js / vue-router - create instance of single file component with props to route toHow to stop the vue component to not call mountedComponent `mounted` fires twice on page loadVue Router - beforeDestroy is called for parent component when children route changesVue JS router component - Cannot re-use JS file that uses webpack imports after navigating between routesVue re-creates the parent component when changes routesVue Dynamic Layouts mounting router-view component twice
Employee lack of ownership
How can I track script which gives me "command not found" right after the login?
How to write cleanly even if my character uses expletive language?
SOQL: Populate a Literal List in WHERE IN Clause
The difference between「N分で」and「後N分で」
What's the meaning of “spike” in the context of “adrenaline spike”?
Do I need to be arrogant to get ahead?
How to terminate ping <dest> &
Welcoming 2019 Pi day: How to draw the letter π?
Are all passive ability checks floors for active ability checks?
What do Xenomorphs eat in the Alien series?
My Graph Theory Students
Gantt Chart like rectangles with log scale
If curse and magic is two sides of the same coin, why the former is forbidden?
Can I use USB data pins as power source
Opacity of an object in 2.8
Are there verbs that are neither telic, or atelic?
Do I need life insurance if I can cover my own funeral costs?
Unexpected result from ArcLength
Why do passenger jet manufacturers design their planes with stall prevention systems?
Why do Australian milk farmers need to protest supermarkets' milk price?
A link redirect to http instead of https: how critical is it?
How to change two letters closest to a string and one letter immediately after a string using notepad++
Why doesn't using two cd commands in bash script execute the second command?
Vue component fires mounted() & created() twice on page reload but once when navigated to via a route
2019 Community Moderator ElectionVue v-on:click does not work on componentVueJs 2.0 - how to listen for `props` changesWebpack fails to mount Vue componentsvue.js / vue-router - create instance of single file component with props to route toHow to stop the vue component to not call mountedComponent `mounted` fires twice on page loadVue Router - beforeDestroy is called for parent component when children route changesVue JS router component - Cannot re-use JS file that uses webpack imports after navigating between routesVue re-creates the parent component when changes routesVue Dynamic Layouts mounting router-view component twice
Does anyone know why this might be happening?
I've added a console.log() to the beforeDestroy() hook to see whether the component is being created and destroyed and created again but nothing
vue.js vuejs2 vue-component vue-router
add a comment |
Does anyone know why this might be happening?
I've added a console.log() to the beforeDestroy() hook to see whether the component is being created and destroyed and created again but nothing
vue.js vuejs2 vue-component vue-router
usethis.$nextTick(() => // methods )
– Ohgodwhy
Mar 6 at 20:07
stackoverflow.com/users/1206267/ohgodwhy doesn't work sadly
– uniisoverrated
Mar 9 at 10:15
add a comment |
Does anyone know why this might be happening?
I've added a console.log() to the beforeDestroy() hook to see whether the component is being created and destroyed and created again but nothing
vue.js vuejs2 vue-component vue-router
Does anyone know why this might be happening?
I've added a console.log() to the beforeDestroy() hook to see whether the component is being created and destroyed and created again but nothing
vue.js vuejs2 vue-component vue-router
vue.js vuejs2 vue-component vue-router
asked Mar 6 at 19:56
uniisoverrateduniisoverrated
62
62
usethis.$nextTick(() => // methods )
– Ohgodwhy
Mar 6 at 20:07
stackoverflow.com/users/1206267/ohgodwhy doesn't work sadly
– uniisoverrated
Mar 9 at 10:15
add a comment |
usethis.$nextTick(() => // methods )
– Ohgodwhy
Mar 6 at 20:07
stackoverflow.com/users/1206267/ohgodwhy doesn't work sadly
– uniisoverrated
Mar 9 at 10:15
use
this.$nextTick(() => // methods )
– Ohgodwhy
Mar 6 at 20:07
use
this.$nextTick(() => // methods )
– Ohgodwhy
Mar 6 at 20:07
stackoverflow.com/users/1206267/ohgodwhy doesn't work sadly
– uniisoverrated
Mar 9 at 10:15
stackoverflow.com/users/1206267/ohgodwhy doesn't work sadly
– uniisoverrated
Mar 9 at 10:15
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55031236%2fvue-component-fires-mounted-created-twice-on-page-reload-but-once-when-nav%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55031236%2fvue-component-fires-mounted-created-twice-on-page-reload-but-once-when-nav%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
use
this.$nextTick(() => // methods )
– Ohgodwhy
Mar 6 at 20:07
stackoverflow.com/users/1206267/ohgodwhy doesn't work sadly
– uniisoverrated
Mar 9 at 10:15