1.0.8 • Published 6 years ago

qmis2 v1.0.8

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

全民直播前端集成解决方案

安装

npm i -g qmis2

使用帮助

qmis2 -h

开发规范

关于模块id的说明:

  • 模块id=命名空间:组件路径
  • 如果是当前模块,『命名空间:』可以简写为『/』
  • 当文件与目录同名时,比如 pulbic/a/a.tpl 可以简写为 『pulbic/a』
  • {% widget %} 可以省略开头的『widget/』

示例:

  1. 支持模板中相对路径或绝对路径定位当前模块下的资源
{% require './foo/foo.js' %}
{% require '/public/foo/foo.js' %}
{% widget './bar/bar.tpl' %}
{% widget '/view/widget/bar/bar.tpl' %}
{% inherbit './layout.tpl' %}
  1. 支持短路径写法
{# 假设当前项目命名空间为 `index` #}
{% require './foo' %} 等价于 {% require './foo/foo.js' %}
{% widget './bar' %}  等价于 {% widget './bar/bar.tpl' %}
{% require 'public/dialog' %} 等价于 {% require '/public/dialog/dialog.js' %}
{% widget 'footer' %} 等价于 {% widget '/view/widget/footer/footer.tpl' %}
{% inherbit 'basic' %} 等价于 {% inherbit '/view/layout/basic/basic.tpl' %}
  1. 跨模块引用资源
{% require 'common:public/dialog' %}  =>  {% require 'common:public/dialog/dialog.js' %}
{% require 'common:public/dialog/dialog.ext.js' %}
{% widget 'common:dialog' %}  =>  {% widget 'common:widget/dialog/dialog.tpl' %}
{% inherbit 'common:basic' %}  =>  {% inherbit 'common:layout/basic/basic.tpl' %}