Skip to content

关于 UI widget package 的构想 #3

Description

@xydudu

像 comment,photoview 这样的控件,由模板,CSS,以及javascript构成,像 photoview 还需要针对各种不同情况扩展一些方法,比如: mod_photoview, mod_photoview2。

这么多的关联文件如果散落在各个文件夹,控件多后,必然会造成文件难找,每引入一个控件,都需要在页面中引入一大堆的依赖。

由此,我想将这些控件以 package 的形式发布,在honey.go中只需要标记出为 package,就自然的把相应该的控件包引入进来,就不需要手动的引入过多的依赖

比如 comment 有 widget:comment, tpl:comment 还有 comment.css comment.ie.css 这四个文件,可能可以打包到 directive 文件夹,页面中只需要

honey.go(directive:comment) 

就自动的引入包内所有文件就好。比之现在的

honey.go(widget:comment, tpl:comment) //css 在 widget:comment 内引入

当然要方便得多。

所以 honey 应该识别一下,如果是 directive 就要引入包文件,此时包文件夹内应该有一个类似 package.json 的文件来组织这些依赖。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions