Git Product home page Git Product logo

inspiration's People

Contributors

leopen-hu avatar

Watchers

 avatar

inspiration's Issues

vue-admin

类似于ng-admin类似的框架,直接根据数据表配置就可以生成简单的admin管理站点

组件数据的共享与独立

组件数据的共享与独立

现象

在开发中我们经常会出现一种场景,多个相同组件数据的展示,但是它们之间的数据是相互独立的,如果我们使用了基于redux的全局store,那么我们就会面临一种情况,在组件创建的时候动态添加一个独立的id,并在store中以此id为key动态扩展我们的store,然后维护好组件id与store中key的对应关系,在组件销毁时也删除store中对应的数据。同时也会存在一种情况,多个组件之间需要使用共同的数据,当一个组件中的数据发生变化时,另一个组件也随之变化,这个时候又要求二者在store中的数据是共享的,这个时候又需要多个组件指定相同的数据源。甚至有更复杂的情况会要求部分数据共享,部分数据独立。

典型场景

  • 独立数据

用户自定义看板,用户可以自己给看板添加各种功能,功能之间不会相互影响。比如在看板中添加对多支股票的关注,其中A股票关注行情,B股票关注行情和对应公司风险...那么这个时候A,B股票中行情的组件其实是同一个,但是需要指定不同的数据源。

  • 共享数据

用户自定义分析工具,用户可以自己添加若干个行情分析工具,在各个分析工具中可以指定使用不同的分析模型来预测同一家公司的未来行情走向并对比,并且在编辑其中一个的数据后,另一个也会相应发生变化。此时分析工具组件是完全一致的并且数据源也是共享的。

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.