Comments (6)
查明是工具在编译前压缩处理有问题,已经修复,并且示例也放了一张图片。
模板引擎本身已经很稳定,也经历大大大小小的商业项目考验。编译工具刚刚由DEMO转为测试版,潜在的问题比较多。后面我会在商业项目中去检验他,逐步完善。
from art-template.
再提个优化建议:一个文件里多次include进同样的文件时候,会生成几个相同的依赖:
var dependencies = { "./include/_banner": require("./include/_banner"), "./include/waterfall": require("./include/waterfall"), "./include/waterfall": require("./include/waterfall") };
例如有重复的waterfall依赖,虽然不会抛错,但毕竟不太好。。
from art-template.
好的,下次更新将优化。现在旅行途中,十天后回来处理此问题
from art-template.
再反馈个感觉比较严重的问题吧:
var helpers = require("./$helpers"); helpers.$render = function (id, data) { return dependencies[id](data); };
这个代码里的 dependencies 引用的对象 一直 是最后一次require进去的模块的 dependencies对象。例如:
var a = require("./a"); var b = require("./b"); var c = require("./c");
如果在代码初始化时相继执行了以上三句,dependencies对象就会是c模块里的dependencies,而调用a,b都是执行的c里的dependencies,这个就直接造成错误了。这个应该是把helpers抽离出来,并且用了helper.$render方法的缘故,这方面的设计上是不是应该再斟酌一下?
from art-template.
确认是个Bug。我决定在模块返回的函数中重写helpers.$render引用,确保它在当前上下文中,明天将更新代码解决上面两个Bug
from art-template.
已经更新代码,问题解决
from art-template.
Related Issues (20)
- 请问遍历对象的原始语法是怎么写?
- 标准语法 if 多条件编译报错 HOT 1
- Help. 请教 vue2 项目中 如何 使用 cdn 引入 art-template 并使用?
- 对deno的支持
- react项目通过 import artTemplate from "art-template" 引入异常 HOT 4
- 渲染的数据是多行,会导致错误 HOT 1
- 在 js 中配置模板,能使用 include 吗?
- 如何使用Arttemplate在页面上遍历一个数字?
- {{@@item.value}} 在{{each }}中无效
- art-template native v3.0.0 360 IE6内核版本显示模板源码
- 异步自定义filter?
- 模板解析后占位符不准确 HOT 2
- Webpack loader, syntax include with parameter looks doesn't work. HOT 2
- 请问可以在nestJS中配置art-template吗? HOT 1
- 该如何将类中的 this 传入 $data 里呢 HOT 2
- Doesn't work with bun.js because require.extensions[template.defaults.extname] = extension; looks like it's not supported HOT 2
- 用express art-template渲染出来的页面源码有空格 HOT 3
- 能出个serviceWorker版本吗? HOT 1
- 如何插值为html标签的属性,而不仅是插值为内容? HOT 4
- 是否可以支持自定义的异步函数?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from art-template.