Skip to content

autoresult data loading problem when route change #12

Closed
@DC-507

Description

@DC-507

Environment: Meteor 2.7.2; VUE 3.2.29; vuejs:vue3; vuex 4.0.2; vue-router:4.0.12

When I use router change different router-view, if they use same collection subscribe() and autoResult(). autoResult() at the second router-view still loading the result subcribe in the first one. and the second router-view's subscribe will render the veiw until waiting this process finished. the result looks like being pollution by pre-router-view's result. if the result is big then hundreds records, it will take a longtime.

I don't known, it is something i missed?

code in pre-route-view:

subscribe("getAllofSF");
const fullSFQ_RS = autoResult(() => SurveyForms.find({}));

    const totalUQ = computed(() => {
      var tmpParts = new Map();
      if (totalUQ_RS.value.length > 0 && fullSFQ_RS.value.length > 0) {

code in second-route-view:

subscribe("getTimesofSF", ss_sf_sn);
const currentSFQ_RS = autoResult(() => SurveyForms.find({}));

    var totalSF = ref({});
    totalSF = computed(() => {
      var tmpParts = new Map();
      var totalSFList = [];
      if (currentSFQ_RS.value.length > 0) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions