Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] 更改画板的宽高后,再修改画板上的元素,保存和预览时候没有应用最新的样式。 #363

Open
HuiFeiYa opened this issue Jul 26, 2021 · 0 comments

Comments

@HuiFeiYa
Copy link
Contributor

Describe the bug
更改画板的宽高后,再修改画板上的元素,保存和预览时候没有应用最新的样式。

To Reproduce

  1. 更改画板宽高
  2. 移动元素
  3. 预览,还是移动前的样式

Expected behavior
移动效果没生效

** 解决方案 **
core/store/modules/works.js

 updateWork ({ commit, state }, payload = {}) {
    // update work with strapi
    const work = {
      ...state.work,
      ...payload
    }
    commit('setWork', work)
  },

改为

  updateWork (context, payload = {}) {
    const { state } = context
    // update work with strapi
    const work = {
      ...state.work,
      ...payload
    }
    state.work = work
  }

commit('setWork',work) 会实例话一个新的对象赋值给 state.work ,切断 elementwork.pages[0].elements[1] 指针引用关系,本来是同一个指针。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant