From 2896c7a6cb8886d1afaf1329d951ffe17f2be61d Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Mon, 24 Jan 2022 23:46:22 +0800 Subject: [PATCH] 1 --- src/app/pipes/show-type.pipe.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/app/pipes/show-type.pipe.ts diff --git a/src/app/pipes/show-type.pipe.ts b/src/app/pipes/show-type.pipe.ts new file mode 100644 index 0000000..7763654 --- /dev/null +++ b/src/app/pipes/show-type.pipe.ts @@ -0,0 +1,19 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'showType' +}) +export class ShowTypePipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 1: + return '小程序'; + case 2: + return 'H5'; + case 3: + return '银联'; + } + } + +}