Coder Social home page Coder Social logo

Comments (1)

whinc avatar whinc commented on May 26, 2024

附议,我也遇到类似问题,A和B 两个画布的节点 shape 不同,开启 useLocalStorage 后从 A 画布复制节点到 B 画布时,会报错。这里有几个提议供参考:

  1. useLocalStorage 目前存储时,storage key 是固定的,value 是被复制节点的数据,期望支持设置 storage 的 key 类似 [key: string]: nodes,或者 value 中再划分一层,支持按用户自定义的 key 存储,类似 'x6.clipboard.cells': { [key: string]: nodes}
  2. 暴露 storage 的序列化和反序列化的钩子函数,以便应用层在复制和粘贴时,有机会对数据进行校验和加工处理,例如校验数据是否处于有效期、是否格式正确等等,不通过时则可以忽略加载数据或删除数据
  3. 暴露 Storage 的读写 API,并支持异步读写,以便应用侧自定义后端存储,例如使用 SessionStorage、IndexDB、或者 web server 实现云端复制粘贴

from x6.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.