Git Product home page Git Product logo

Comments (6)

pulo avatar pulo commented on July 26, 2024

我已经找到解决方案了,输出还是全部输出 然后转换成JQ对象 通过FIND来获取~~

from juicer.

PaulGuo avatar PaulGuo commented on July 26, 2024

OK. 不过这部分确实应该是模板引擎之外来做~ :)

from juicer.

pulo avatar pulo commented on July 26, 2024

嗯,其实我现在更想知道的是有没有什么推荐的通用性高点的数据结构

我目前是这样的
{
subTPL:'<HTML>',
data:{
key1:value1,
key2:value2,
item:[
0:{xxxx}
1:{xxxx}
2:{xxxx}
]
}
}
如果要调用模板里加入
{@each data.item as obj}
include{subTpl, obj}
{@/each}

但是如果需要用到多个模板、或者说需要多层嵌套的话,就不知道怎么样的数据格式更合理点了
想知道你们是怎么样的~,有没有推荐的更方便点的数据格式~~~

from juicer.

PaulGuo avatar PaulGuo commented on July 26, 2024

@ZhuMinqi 通过script方式书写/存放模板,这样使用模板嵌套会不会好很多?

from juicer.

pulo avatar pulo commented on July 26, 2024

目前我的模板是放在一个专门的.TPL模板文件里面,AJAX请求后作为字符串来处理的。

我在想怎么样让模板开发人员 来决定对数据结构的定义 以及 模板所需依赖的文件或代码。这样的话或许能做到更好的数据及模板的分离,但目前还没什么好的头绪~

from juicer.

PaulGuo avatar PaulGuo commented on July 26, 2024

上线时候可以尝试下 Juicer 的预编译,可以省去第一次编译模板的耗时,如果对性能追求极致的话再合适不过了。

from juicer.

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.