From 84f981a8cb83e91b815ae29c5592a17c0e71005a Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 21 Jun 2022 17:25:24 +0800 Subject: [PATCH] feat(components): add switch component Signed-off-by: Ryan Wang --- .../src/components/switch/Switch.story.vue | 18 +++++ .../src/components/switch/Switch.vue | 77 +++++++++++++++++++ .../switch/__tests__/Switch.spec.ts | 9 +++ .../components/src/components/switch/index.ts | 1 + 4 files changed, 105 insertions(+) create mode 100644 packages/components/src/components/switch/Switch.story.vue create mode 100644 packages/components/src/components/switch/Switch.vue create mode 100644 packages/components/src/components/switch/__tests__/Switch.spec.ts create mode 100644 packages/components/src/components/switch/index.ts diff --git a/packages/components/src/components/switch/Switch.story.vue b/packages/components/src/components/switch/Switch.story.vue new file mode 100644 index 00000000..b4bd1b0c --- /dev/null +++ b/packages/components/src/components/switch/Switch.story.vue @@ -0,0 +1,18 @@ + + diff --git a/packages/components/src/components/switch/Switch.vue b/packages/components/src/components/switch/Switch.vue new file mode 100644 index 00000000..04b500af --- /dev/null +++ b/packages/components/src/components/switch/Switch.vue @@ -0,0 +1,77 @@ + + + diff --git a/packages/components/src/components/switch/__tests__/Switch.spec.ts b/packages/components/src/components/switch/__tests__/Switch.spec.ts new file mode 100644 index 00000000..b7772449 --- /dev/null +++ b/packages/components/src/components/switch/__tests__/Switch.spec.ts @@ -0,0 +1,9 @@ +import { describe, expect, it } from "vitest"; +import { VSwitch } from "../index"; +import { mount } from "@vue/test-utils"; + +describe("Switch", () => { + it("should render", () => { + expect(mount(VSwitch)).toBeDefined(); + }); +}); diff --git a/packages/components/src/components/switch/index.ts b/packages/components/src/components/switch/index.ts new file mode 100644 index 00000000..2079033d --- /dev/null +++ b/packages/components/src/components/switch/index.ts @@ -0,0 +1 @@ +export { default as VSwitch } from "./Switch.vue";