We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.5.17-beta.0
http://www.baidu.com
vue官网有段代码是关于异步组件的,代码如下:
const AsyncComponent = (path) => ({ // 需要加载的组件 (应该是一个 Promise 对象) component: import(@/${path}), // 异步组件加载时使用的组件 loading: Loading, // 加载失败时使用的组件 error: LoadingError, // 展示加载时组件的延时时间。默认值是 200 (毫秒) delay: 200, // 如果提供了超时时间且组件加载也超时了, // 则使用加载失败时使用的组件。默认值是:Infinity timeout: 1000 });
Promise
@/${path}
Infinity
请问页面如果局部组件加载失败了,怎么重新重新加载局部组件? 应用场景:在听歌曲时,可以给歌曲评论,查看评论列表。如果组件加载失败了,怎么能重新加载局部组件?而不是通过刷新整个页面达到目的?如果刷新整个页面则会造成歌曲重播,这个是不符合业务场景的。
想知道页面局部组件怎么重新加载或者重新创建渲染
页面局部组件加载失败后怎么重试加载局部组件?
The text was updated successfully, but these errors were encountered:
强制父组件重新渲染即可。
Sorry, something went wrong.
@yyx990803 我要反馈bug了,我在父组建vif重新渲染无效,整个vue也destroy依旧不好使。3.0的vu e
报 bug 请新开 issue,带上重现。
No branches or pull requests
Version
2.5.17-beta.0
Reproduction link
http://www.baidu.com
Steps to reproduce
vue官网有段代码是关于异步组件的,代码如下:
const AsyncComponent = (path) => ({
// 需要加载的组件 (应该是一个
Promise
对象)component: import(
@/${path}
),// 异步组件加载时使用的组件
loading: Loading,
// 加载失败时使用的组件
error: LoadingError,
// 展示加载时组件的延时时间。默认值是 200 (毫秒)
delay: 200,
// 如果提供了超时时间且组件加载也超时了,
// 则使用加载失败时使用的组件。默认值是:
Infinity
timeout: 1000
});
请问页面如果局部组件加载失败了,怎么重新重新加载局部组件?
应用场景:在听歌曲时,可以给歌曲评论,查看评论列表。如果组件加载失败了,怎么能重新加载局部组件?而不是通过刷新整个页面达到目的?如果刷新整个页面则会造成歌曲重播,这个是不符合业务场景的。
What is expected?
想知道页面局部组件怎么重新加载或者重新创建渲染
What is actually happening?
页面局部组件加载失败后怎么重试加载局部组件?
The text was updated successfully, but these errors were encountered: