gpt4 book ai didi

javascript - 你能增加 meteor 中的 react 变量吗?

转载 作者:行者123 更新时间:2023-12-01 02:56:37 25 4
gpt4 key购买 nike

是否可以增加 meteor 中的 react 变量?

例如:

var price = new ReactiveVar(0)

somefunction()=>{
price += 5;
}

最佳答案

当然有可能。否则响应式(Reactive)变量将毫无用处。

const price = new ReactiveVar(0);

const somefunction = () => {
price.set(price.get() + 5);
};

有用链接:ReactiveVar documentation .

关于javascript - 你能增加 meteor 中的 react 变量吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46669148/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com