mm_tpl 2.4.1 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,29 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>超级美眉Art模板引擎</title>
6
+ </head>
7
+ <body>
8
+ <h5>系统名称测试123</h5>
9
+ <p>您真的是人才!</p>
10
+ <p>您真的是人才!</p>
11
+ <ul>
12
+ <li>\·$·{· value }</li>
13
+ <li>\·$·{· value }</li>
14
+ </ul>
15
+ <ul>
16
+ <li>123</li>
17
+ <li>234</li>
18
+ </ul>
19
+ <ul>
20
+ <li>\·$·{· value }</li>
21
+ <li>\·$·{· value }</li>
22
+ </ul>
23
+ <script type="text/javascript">
24
+ var a_0 =123;
25
+ var a_1 =234;
26
+ </script>系统名称计算
27
+ 123123'priceNIHAO'#计算
28
+ </body>
29
+ </html>
package/index.js CHANGED
@@ -205,11 +205,23 @@ Tpl.prototype.render_before = function(body, model, options) {
205
205
  return ret;
206
206
  };
207
207
 
208
+ /**
209
+ * 用于注入全局函数
210
+ * @param {Object} m
211
+ */
212
+ Tpl.prototype.loadFunc_before = function(m) {
213
+ // m.$i18n = function(key) {
214
+ // return $.i18n(key);
215
+ // }
216
+ return m;
217
+ }
218
+
208
219
  /**
209
220
  * 加载函数
210
221
  * @param {Object} m 模型
211
222
  */
212
223
  Tpl.prototype.loadFunc = function(m) {
224
+ this.loadFunc_before(m);
213
225
  var _this = this;
214
226
  m.view = function(file, model, options) {
215
227
  return _this.view(file, Object.assign({}, m, model), options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_tpl",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "这是超级美眉模板帮助类模块,用于MVC模式下的视图渲染",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/test.js CHANGED
@@ -91,7 +91,7 @@ async function test() {
91
91
  }, 2);
92
92
 
93
93
  $.hook.addAction('test', function(m, param) {
94
- return "<div>你好!</div>";
94
+ return "<div>你好!}</div>";
95
95
  }, 1, "测试动作1");
96
96
 
97
97
  // 添加过滤器钩子