Giter VIP home page Giter VIP logo

Comments (6)

edison1105 avatar edison1105 commented on June 8, 2024 2

@wcldyx 这是因为在开发环境会在元素上定义 __vnode,公开给 vue-devtools 使用。生产环境不会内存溢出

if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) {
Object.defineProperty(el, '__vnode', {
value: vnode,
enumerable: false,
})
Object.defineProperty(el, '__vueParentComponent', {
value: parentComponent,
enumerable: false,
})
}

from core.

edison1105 avatar edison1105 commented on June 8, 2024 1

@wcldyx
image
类似的问题已经有人提了好多次了。

from core.

edison1105 avatar edison1105 commented on June 8, 2024

第一个问题的复现是把 mode 和 include 都去掉吗?

  <Transition>
    <KeepAlive>
      <A v-if="show" />
    </KeepAlive>
  </Transition>

image
把 mode 和 include 都去掉后,不停切换并不存在内存泄漏

from core.

wcldyx avatar wcldyx commented on June 8, 2024

第一个问题的复现是把 mode 和 include 都去掉吗?

  <Transition>
    <KeepAlive>
      <A v-if="show" />
    </KeepAlive>
  </Transition>

image 把 mode 和 include 都去掉后,不停切换并不存在内存泄漏

两个问题都是在有include 的情况下会出现内存溢出

from core.

wcldyx avatar wcldyx commented on June 8, 2024

@wcldyx 这是因为在开发环境会在元素上定义 __vnode,公开给 vue-devtools 使用。生产环境不会内存溢出

if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) {
Object.defineProperty(el, '__vnode', {
value: vnode,
enumerable: false,
})
Object.defineProperty(el, '__vueParentComponent', {
value: parentComponent,
enumerable: false,
})
}

6啊,你是怎么定位到这个问题的

from core.

edison1105 avatar edison1105 commented on June 8, 2024

Leave it open because the second issue has not been fixed

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.