programing

더미에서 Vuex 명확한 데이터입니다.

javaba 2022. 7. 27. 23:32
반응형

더미에서 Vuex 명확한 데이터입니다.

  • Issue-언제 하나가 투사하고 구조를 보여 주는 라우팅이 나열된 사업을 클릭합니다.168mb 중 3/데이터, 그때 data이 될는 2GB.
  • 언제 나는 다시 사업에는 2GB내 히프 머무는 거야, 나는 큰 데이터로 그렇게 내가...다시 프로젝트에 투입부터 제가 자바 스크립트 VM인스턴스를 맑게 하기 위해 일하고 있어요.

나는 자바 스크립트 VM인스턴스가 걷히기:어떤 노력을 했는가.

beforeDestroy() {
    this .$store.commit("structures/setStrItemTree", []);
    this.$store._vm.$destroy();
}

그리고 그것과 자바 스크립트 VM인스턴스:는 2GB을 보여 주지 못 했다.

내 코드:

이것은 나의 상태:

    state: {
        structuresTree: [],
    },
    mutations: {
        setStrItemTree: (state, structuresTree) => (state.structuresTree = structuresTree),
    },

나는:프로젝트(Porjects-모든 사업들 목록, Project-쇼 사업 내용 및 구조 보여 주)안에서 나는 2노선을 가지고 있다.

  computed: {
    ...mapGetters("structures", ["allStructuresTree"]),
  },
created() {
      // simple actions that return axios.get API call ....
    this.$store
        .dispatch("structures/getStructureItemTree", 1223)
        .then(({ data, status }: { data: any; status: number }) => {
          debugger
          this.$store.commit("structures/setStrItemTree", data);

          // for some reason data become to be 2GB, If you know why i will appreciate your answer
        });
  },
beforeDestroy() {
    this .$store.commit("structures/setStrItemTree", []);
    this.$store._vm.$destroy();
}

Screenshots:

프로젝트

프로젝트.

지난 프로젝트에

VM힙은 여전히 2gb.

언제 다시 돌출될 것이다.

언급URL:https://stackoverflow.com/questions/66494693/vuex-clear-data-from-heap

반응형