vue.js - 跳过为真时如何触发Vue Apollo Query更新?
问题描述
如果你们中的任何人使用 Vue Apollo 请帮忙,如果我做这样的事情,
export default {
apollo: {
statsAndProfile: {
query: STATS_AND_PROFILE_QUERY,
update({stats, profile}) {
this.stats = stats
this.profile = profile
},
skip: localStorage.isAuth === 'false'
},
},
data(){
return {
stats: null
profile: null
}
}
}
然后在其中一个组件中created() { this.$apollo.queries.statsAndProfile.start() }
它不会更新,this.stats
或者this.profile
,更新仅在从一开始就为假时才起作用。有办法解决吗?
解决方案
推荐阅读
- c# - 如何使用 c# 从 modbus RTU rs323 读取浮点数据
- javascript - 为什么当我单击同一页面中的一个下拉列表时页面中的其他下拉列表会更新
- android - 在 Android 8 Oreo 的 WifiManager 的 startscan 方法中没有收到响应
- android - 使用 kSOAP2 传递字符串数组
- iis - 在同一应用程序池中的 64 位应用程序中使用 32 位 dll
- ios - Objective c 从 reposnse 获取参数值
- django - 如何将所需的额外字段添加到 Django 注册表单
- python - 同一数据框中的列映射
- asp.net - 无法正确读取 cookie
- c# - c#monogame visual studio - 游戏菜单不工作,敌人击中时游戏结束屏幕不工作