Vue Apollo重新查询事件

问题描述

我在Component实例中有一个查询:

@Component({
  apollo: {
    cartProducts: {
      query: GET_CART_PRODUCTS,loadingKey: "loading",},}
})

它正在正确加载我的数据。然后,我更改数据库中的数据,并希望在单击时重新获取数据,从而调用该函数:

  refresh() {
    this.$apollo
      .query({
        query: GET_CART_PRODUCTS,})
      .then((res: any) => (this.cartProducts = res.data.cartProducts))
      .catch((err: any) => console.log(err));
  }

但是它不会更新cartProducts属性,也不会给我任何错误。尽管如果我刷新页面,就会有新数据。在我的Apollo配置中,我具有这样的属性fetchPolicy: "network-only"。这种行为可能会引起什么?提前感谢!

解决方法

答案很简单,麻烦您,我不得不在Google上搜索更多。

<ComboBox items="{/myEntity}">
  <core:Item key="{key}" text="{text}" enabled="{= ${Valuedefault} !== 'X'}"/>
</ComboBox>

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...