mm_tpl 2.1.5 → 2.1.7

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.
Files changed (2) hide show
  1. package/index.js +15 -2
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -70,6 +70,11 @@ class Tpl {
70
70
  * 错误提示
71
71
  */
72
72
  this.error = null;
73
+
74
+ /**
75
+ * 初始化
76
+ */
77
+ this.init(config);
73
78
  }
74
79
  }
75
80
 
@@ -90,6 +95,14 @@ Tpl.prototype.set_config = function(config) {
90
95
  }
91
96
  };
92
97
 
98
+ /**
99
+ * 初始化
100
+ * @param {Object} config 配置参数
101
+ */
102
+ Tpl.prototype.init = function(config) {
103
+ this.set_config(config);
104
+ }
105
+
93
106
  /**
94
107
  * 渲染模板(之前)
95
108
  * @param {String} body 模板
@@ -229,9 +242,9 @@ Tpl.prototype.view = function(file, model, options) {
229
242
  if (!f.hasFile()) {
230
243
  f = file.fullname(this.dir + this.config.defualt_theme);
231
244
  if (!f.hasFile()) {
232
- f = file.fullname(this.defualt_dir + this.config.current_theme);
245
+ f = file.fullname(this.config.defualt_dir + this.config.current_theme);
233
246
  if (!f.hasFile()) {
234
- f = file.fullname(this.defualt_dir + this.config.defualt_theme);
247
+ f = file.fullname(this.config.defualt_dir + this.config.defualt_theme);
235
248
  }
236
249
  }
237
250
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_tpl",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
4
4
  "description": "这是超级美眉模板帮助类模块,用于MVC模式下的视图渲染",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -27,6 +27,6 @@
27
27
  "homepage": "https://github.com/qiuwenwu/mm_tpl#readme",
28
28
  "dependencies": {
29
29
  "art-template": "^4.13.2",
30
- "mm_expand": "^1.5.1"
30
+ "mm_expand": "^1.5.5"
31
31
  }
32
32
  }