{loadingContent}
-
{switchContent}
+ {this.shape !== 'line' &&
{switchContent}
}
);
},
diff --git a/src/switch/type.ts b/src/switch/type.ts
index 33b32458b..9b090f65e 100644
--- a/src/switch/type.ts
+++ b/src/switch/type.ts
@@ -31,6 +31,11 @@ export interface TdSwitchProps {
* @default false
*/
loading?: boolean;
+ /**
+ * 开关形状。`line` 形态不展示开关内容 `label`
+ * @default circle
+ */
+ shape?: 'circle' | 'round' | 'line';
/**
* 开关尺寸
* @default medium