Constructors
constructor
- new Templete(tpl: string, config?: ITempleteConfig): Templete
-
Parameters
-
tpl: string
-
config: ITempleteConfig = ...
Properties
close
close: string
open
open: string
tpl
tpl: string
Static cache
cache: object = ...
Methods
Private error
- error(e: any, tplog?: string): string
-
Parameters
-
e: any
-
tplog: string = ''
Returns string
Private exp
-
Parameters
Returns RegExp
parse
-
Parameters
Returns any
Private query
- query(type?: any, a?: any, b?: any): RegExp
-
Parameters
-
Optional type: any
-
Optional a: any
-
Optional b: any
Returns RegExp
render
- render(model: object, callback?: (tpl: string) => string): any
-
Parameters
-
model: object
-
Optional callback: (tpl: string) => string
-
-
Parameters
Returns string
Returns any
返回模板渲染完的字符串
Static create
- create(str: string, config?: ITempleteConfig): Templete
-
Parameters
-
str: string
-
Optional config: ITempleteConfig
返回模板对象实例
Private Static escape
- escape(html: any): string
-
Parameters
Returns string
模板渲染处理类