如何解决根据url参数设置fetchOnServer
是否可以基于URL参数设置fetchOnServer?例如如果URL具有?renderonserver = true,请使用fetchOnServer:true。
更新:
让我进一步解释一下:
我有两个网址,例如/ myview?renderonserver = true,/ myview?renderonserver = false,
,代码如下:
export default {
async fetch() {
this.posts = await this.$http.$get(
'https://jsonplaceholder.typicode.com/posts/'
)
},fetchOnServer: true
}
It is possible for the same view to change fetchOnServer based on what is used in the URL parameters? (on the first load of the page each time).
Thanks!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。