Skip to content

Conversation

fit2bot
Copy link
Contributor

@fit2bot fit2bot commented Mar 24, 2025

fix: applet host create protocol err

@fit2bot fit2bot requested a review from a team March 24, 2025 03:25
@@ -75,6 +75,7 @@ export default {
}
},
async mounted() {
this.$route.query.platform = 'RemoteAppHost'
this.loading = false
},
methods: {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot analyze the given code without it, but I can suggest some general tips based on previous discussions with developers who have experience working with Vue.js:

  1. Use useLoader instead of creating an object manually: This would improve your component's performance since loading and unloading data are handled better.

  2. Avoid using global variables to hold shared state: Using global variables like $route, which may be accessed outside of a component during runtime, could lead to issues. Use a custom store if you're planning to manage dependencies across components at least temporarily (i.e., for this case).

Here is the updated line after optimizing suggested:

async mounted() {
  const platform = this.$route.query.platform === 'RemoteAppHost' ? 'RemoteAppHost' : ''; // Improved condition and spacing 
  this.loading = false;
}

Please make sure to run these changes through various unit tests, especially before deploying your application.

Copy link

@BaiJiangJie BaiJiangJie merged commit 6d16473 into v4.8 Mar 24, 2025
5 checks passed
@BaiJiangJie BaiJiangJie deleted the pr@v4.8@fix_applet_host_create branch March 24, 2025 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants