This commit is contained in:
zhengyi 2023-12-29 22:44:13 +08:00
parent 762f21ba78
commit f10d522a79
2 changed files with 3 additions and 2 deletions

View File

@ -6,7 +6,7 @@
.invalid-type {
color: red;
margin: 5px;
font-size: 20px;
text-align: center;
padding: 10px;
background-color: lightpink;

View File

@ -1,5 +1,6 @@
import {TipsProvider} from "./tips-provider";
import {ProviderList} from "./provider-list";
import {RENDER_CLASS} from "../constant";
export declare interface Provider {
check: (type: string) => boolean
@ -17,7 +18,7 @@ export class ProviderFactory {
process(type: string, content: string, options: IOptions = {
cdn: "."
}) {
let html = "<h2 class='invalid-type'>Invalid Type!</h2>"
let html = `<div class='${RENDER_CLASS} invalid-type'>Invalid Type</div>`
this.providers.forEach(provider => {
if (provider.check(type)) {
html = provider.process(type, content, options)