question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VUEJS2.0.0.rc.2 vm.$destroy(true) does not work

See original GitHub issue

Vue.js version

2.0.0.rc.2

Reproduction Link

https://jsfiddle.net/matiascx/apokjqxx/

Steps to reproduce

click the destroy A button in the fiddle

What is Expected?

A component is destroyed

What is actually happening?

when click the button, the following code will be executed:

this.$destroy(true)

Unfortunately the component is not destroyed as expected. In vuejs.1.0.26, that works well. Please check whether or not it is a bug of vue2.0 or something i have done wrong

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
yyx990803commented, Aug 29, 2016

@cnweibo fyi the usage in your fiddle will be considered bad practice in 2.0 - in general you should not manually destroy instances, or manipulate its DOM element when the instance is rendered by a parent component. This is why $destroy doesn’t provide that argument anymore and methods like $remove, $appendTo are deprecated.

Again, the recommended usage is making it “data-driven”, make the <ca> component controlled by a v-if in the parent scope, and toggle that v-if by emitting an event.

1reaction
cnweibocommented, Aug 29, 2016

@yyx990803 , same question with sqal. Currently, i solve this in-compatible issue with additional code in addition to the vm.$destroy():

vm.$el.parentNode.removeChild(vm.$el)

It seems strange, i must append above code with vm.$destroy(true) itself If we can still support that parameter, it will be great thanks!~

Read more comments on GitHub >

github_iconTop Results From Across the Web

VUEJS2.0.0.rc.2 vm.$destroy(true) does not work
With vuejs2.0.0.rc.2, i can not destroy a component with this.$destroy(true) Although the event listener removed, but the dom node is not ...
Read more >
vuejs/vue - Gitter
Vuex (or any Flux-like store) enforces a rule that your main data store can only be changed in certain, specific, fixed ways. So......
Read more >
non-unique polygons id slot values - You.com | The Search ...
This is an example of a list with two separate (not adjacent or overlapping) ... true\n });\n timerFunc = function () {\n counter...
Read more >
32 keyboard limit: mb memory poi - CSDN
In this post he works with BigQuery – Google's serverless data warehouse – to run k-means clustering over Stack Overflow's published dataset, which...
Read more >
https://git.opensocial.at/friendica/friendica-addo...
If you are on the `dev` branch, files here are **NOT** up to date. ... +var REJECTED = 1; +var PENDING = 2;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found