File
Public
componentLessDef
|
Default value : `.ch-head {
color:#ad1818;
background: antiquewhite;
padding: 12px;
}`
|
|
Public
componentTemplateDef
|
Default value : `<{{h2##head##@@标题类型@@}} class="ch-head">
{{hello,world!##text##@@标题文本@@}}
{{hello,lmr!##text_else##}}
</{{h2##head##@@标题类型@@}}>`
|
|
Public
previewMode
|
Type : string
|
Default value : 'pc'
|
|
Public
regexProp
|
Type : RegExp
|
Default value : /{{.+?}}/g
|
|
Public
regexPropComment
|
Type : RegExp
|
Default value : /@@.+?@@/g
|
|
Public
regexPropName
|
Type : RegExp
|
Default value : /##.+?##/g
|
|
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class HtmlBuilderSettingService {
// 组件模板解析正则表达式
public regexProp: RegExp = /{{.+?}}/g;
public regexPropName: RegExp = /##.+?##/g;
public regexPropComment: RegExp = /@@.+?@@/g;
// 预置模板
public componentTemplateDef = `<{{h2##head##@@标题类型@@}} class="ch-head">
{{hello,world!##text##@@标题文本@@}}
{{hello,lmr!##text_else##}}
</{{h2##head##@@标题类型@@}}>`;
// 预置样式
public componentLessDef = `.ch-head {
color:#ad1818;
background: antiquewhite;
padding: 12px;
}`;
// 预览模式:pc、phone
public previewMode = 'pc';
constructor() { }
}