WoW Weakauras Custom Tricker(WoW Weakauras Custom Tricker)
我试图得到一个触发器,将显示与sunfire debuff比我的自然的优雅buff更少的时间。 lua调用似乎正在拉正确的数字,但它会不断返回真实的?
function () _,_,_,_,_,_,sundur= UnitDebuff("target","Sunfire","player"); _,_,_,_,_,_,NGDur= UnitAura("player","Nature's Grace"); if sundur and NGDur then if sundur<NGDur+2 then return true else return false end end end
I am trying to get a trigger that will show with the sunfire debuff has less time then my nature's grace buff. the lua calls seem to be pulling the correct number, but it is constantly returning true?
function () _,_,_,_,_,_,sundur= UnitDebuff("target","Sunfire","player"); _,_,_,_,_,_,NGDur= UnitAura("player","Nature's Grace"); if sundur and NGDur then if sundur<NGDur+2 then return true else return false end end end
原文:https://stackoverflow.com/questions/21760330
更新时间:2023-06-30 22:06
最满意答案
尝试不使用函数参数这样使用。
const actions = { updateBtn({commit}, data){ commit("test", data); console.log("data is"+data);//data here has a value } } const mutations = { test(state, data) { console.log(data); state.data = data; } }
Try using like this without function parameter.
const actions = { updateBtn({commit}, data){ commit("test", data); console.log("data is"+data);//data here has a value } } const mutations = { test(state, data) { console.log(data); state.data = data; } }
相关问答
更多-
TCP/IP模型是一个________。[2023-10-02]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
看起来我刚刚用{ root: true }参数找到了一种方法。 commit('globalMutation', payload, { root: true }) Looks like I just found a way with the { root: true } parameter. commit('globalMutation', payload, { root: true })
-
据我了解, 行动主要用于可能包含多个突变的异步操作。 所以是的,可以直接使用突变,这就是他们所做的。 只有当你有更复杂的涉及多个突变的工作流程时,才应该将它们包装在一个操作中。 As far as I understood, actions are mainly used for asynchronous operations which might comprise multiple mutations. So yes, it's ok to directly use mutations, that's ...
-
不,你不能在提交后停止变异。 如果您的应用程序仅在某些情况下需要阻止提交,那么您可以将该逻辑放在一个操作中: mutations: { INCREASE_FOO(state) { state.foo++; } }, actions: { increaseFoo({commit}) { if (someCondition) { commit('INCREASE_FOO'); } } } 然后,当通过this.$store.dispatch('increas ...
-
Vuex突变调用另一个突变或同步动作?(Vuex mutation calling another mutation or a synchronous action instead?)[2023-01-20]
你的第一个例子是正确的结构。 确实,与Vuex模块相关的任何异步代码都应保存在模块的操作中,而不是其突变中。 但是,动作不需要是异步的。 它们可以包含与模块相关的同步代码。 这样,正如您在上一个示例中所述,引用Vuex模块的组件无需了解该内部逻辑。 Your first example is the correct structure. It's true that any asynchronous code related to your Vuex module should be held in the ... -
Vuejs致力于突变失败(Vuejs commit to a mutation fails)[2023-04-09]
尝试不使用函数参数这样使用。 const actions = { updateBtn({commit}, data){ commit("test", data); console.log("data is"+data);//data here has a value } } const mutations = { test(state, data) { console.log(data); state.data = data; } } Try using like ... -
Vuex:跳过动作并直接从Component提交Mutation(Vuex: Skipping Action and committing Mutation directly from Component)[2022-03-28]
在您的情况下,使用...mapMutations或$store实例直接在组件中提交突变应该...mapMutations 。 既然你问过最佳实践,那么存在动作的主要原因就是异步性。 Mutations不能是异步的,而Actions可以是,当你可以直接在Component中调用$store.commit这将是一个同步事件,但是当你调用dispatch ,可以在动作块中异步处理提交,而不像Mutations。 因此,最好的做法是在必须异步处理状态时使用Actions来提交对状态的修改,说在提交状态更改之前需要进 ... -
免责声明:突变的作者在这里。 刚刚克隆了你的回购。 需要改变: Mutant目前仅在mri-1.9.3和rbx 19-mode下运行。 我很快就会把它移植到2.0.0。 指定完全限定的常量名称::Elasticrepo::RepoSubset而不是::RepoSubset 另请注意,对于当前的突变体版本,标志--rspec-dm2被简单地替换为--rspec-dm2 --use rspec Mutant可以正确运行此更改。 快乐变异! Disclaimer: Author of mutant here. J ...
-
Vuejs中的属性变异(Property mutation in Vuejs)[2022-12-11]
您根本不需要使用手表。 而不是使用v-model,试试这个: 工作示例: http : //codepen.io/CodinCat/pen/dNQopR?edit = 1010 You don't need to use watch at all. And instead of using v-model, try this: < ...