Skip to content

Commit

Permalink
fix:getters处理优化 (#4)
Browse files Browse the repository at this point in the history
* feat: unibuy-render

* fix:eslint报错

* fix:增加导出钩子函数

* fix:getters处理优化
  • Loading branch information
yaoyun8 authored and hexqi committed Sep 9, 2024
1 parent a805ebb commit 86b4369
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/canvas/render/src/RenderMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@ const globalState = ref([])
const stores = shallowReactive({})
const dataSourceMap = shallowReactive({})

const Func = Function

watchEffect(() => {
reset(stores)
globalState.value.forEach(({ id, state = {}, getters = {} }) => {
const computedGetters = Object.keys(getters).reduce(
(acc, key) => ({
...acc,
[key]: new Func('return ' + getters[key].value)().call(acc, state)
[key]: parseData(getters[key], state, acc)
}),
{}
)
Expand Down

0 comments on commit 86b4369

Please sign in to comment.