GithubHelp home page GithubHelp logo

Comments (14)

hycoon avatar hycoon commented on May 4, 2024

demo 版本 是从 tag 0.1.0迁出的版本
复现步骤为
1、在gaiax studio 种新建普通类型模版
2、将gx-content-uper-grid 模版导入gaiax studio,并且 拖拽到 新建模版中
3、将普通模版 按照demo 中创建 根据模id + mock 数据 得到模版view 的流程 创建view 并展示 ,运行demo
4、出现异常
新建模版 json文件
image

from gaiax.

biezhihua avatar biezhihua commented on May 4, 2024

我看了下你的模板。 你实际上是想使用嵌套一个容器grid模板。

你可以参考这个案例

image

from gaiax.

biezhihua avatar biezhihua commented on May 4, 2024

你自己的例子,之所以报错,是因为数据传递错误了。

模板的渲染是需要数据源的。 这是个前提。 例如A模板、B模板、C模板。

A嵌套了B、B嵌套了C。

A模板是由代码中直接设定数据源的,所以可以在A的databidning中直接写取值逻辑,赋值给节点。

那么B模板由于被嵌套在了A中,那么B该怎么取值?

这个时候B模板,需要由A模板,从databidning中取出一个数据源,传递给B模板。

同理,在使用容器模板的时候,也需要这么做。

from gaiax.

biezhihua avatar biezhihua commented on May 4, 2024

image

from gaiax.

biezhihua avatar biezhihua commented on May 4, 2024

image

from gaiax.

biezhihua avatar biezhihua commented on May 4, 2024

这种模板与模板之间的数据源的传递,的确需要注意一下。

因为看起来就像个普通节点数据绑定一样,所以容易忽视。

这块我们在文档之中也标注一下。

from gaiax.

biezhihua avatar biezhihua commented on May 4, 2024

就想这种A模板嵌套了一个B容器。

写法有两种,

A写$$传数据给B,B自己$nodes取数组给自己赋值。
A写$nodes传数据给B,B自己$$取数组给自己赋值

from gaiax.

biezhihua avatar biezhihua commented on May 4, 2024

你的例子已经给gird模板传递数据源了,但是grid没有给自己绑定数据。

from gaiax.

biezhihua avatar biezhihua commented on May 4, 2024

image

from gaiax.

biezhihua avatar biezhihua commented on May 4, 2024

我们补充下文档关于 “模板之间数据源传递及使用” 的注意事项。

from gaiax.

biezhihua avatar biezhihua commented on May 4, 2024

https://www.yuque.com/g/biezhihua/gaiax/izbht6/collaborator/join?token=4Q1l2cjz4oV9cHIv# 《数据绑定》

from gaiax.

biezhihua avatar biezhihua commented on May 4, 2024

image

from gaiax.

biezhihua avatar biezhihua commented on May 4, 2024

image

from gaiax.

biezhihua avatar biezhihua commented on May 4, 2024

image

from gaiax.

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.