Skip to content

Commit 1196a74

Browse files
committed
feat: 创建alert路由
1 parent 840191a commit 1196a74

File tree

6 files changed

+43
-2
lines changed

6 files changed

+43
-2
lines changed

src/lib/alert/index.ts

Whitespace-only changes.

src/lib/alert/index.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<template>
2+
<div class="jw-alert">alert</div>
3+
</template>
4+
5+
<script setup lang="ts"></script>
6+
<script lang="ts">
7+
export default {
8+
name: "JwAlert",
9+
};
10+
</script>
11+
12+
<style scoped></style>

src/lib/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ import JwCheckbox from "./checkbox/checkbox.vue";
1313
import JwCheckboxGroup from "./checkbox/checkbox-group.vue";
1414
import JwInput from "./input/index.vue";
1515
import JwRadio from "./radio/radio.vue";
16+
import JwRadioGroup from "./radio/radio-group.vue";
1617
import JwSelect from "./select/index.vue";
1718
import JwSwitch from "./switch/index.vue";
1819

20+
import JwAlert from "./alert/index.vue";
1921
import JwDialog from "./dialog/index.vue";
20-
import JwRadioGroup from "./radio/radio-group.vue";
2122
import { openDialog } from "./dialog/openDialog";
2223

2324
import JwAffix from "./affix/index.vue";
@@ -47,6 +48,7 @@ export {
4748
JwSelect,
4849
JwSwitch,
4950
/* 反馈组件 */
51+
JwAlert,
5052
JwDialog,
5153
openDialog,
5254
/* 导航组件 */
@@ -77,6 +79,7 @@ const components = [
7779
JwSelect,
7880
JwSwitch,
7981

82+
JwAlert,
8083
JwDialog,
8184

8285
JwAffix,

src/router/doc-routes.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import RadioDoc from "@/views/doc/radio/index.vue";
2525
import SelectDoc from "@/views/doc/select/index.vue";
2626
import SwitchDoc from "@/views/doc/switch/index.vue";
2727

28+
import AlertDoc from "@/views/doc/alert/index.vue";
2829
import DialogDoc from "@/views/doc/dialog/index.vue";
2930

3031
import AffixDoc from "@/views/doc/affix/index.vue";
@@ -60,7 +61,10 @@ const docMenus = {
6061
{ path: "select", component: SelectDoc, name: "选择器 Select" },
6162
{ path: "switch", component: SwitchDoc, name: "开关 Switch" },
6263
],
63-
反馈组件: [{ path: "dialog", component: DialogDoc, name: "对话框 Dialog" }],
64+
反馈组件: [
65+
{ path: "alert", component: AlertDoc, name: "提示 Alert" },
66+
{ path: "dialog", component: DialogDoc, name: "对话框 Dialog" },
67+
],
6468
导航组件: [
6569
{ path: "affix", component: AffixDoc, name: "固钉 Affix" },
6670
{ path: "backtop", component: BacktopDoc, name: "回到顶部 Backtop" },
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<preview>基础用法</preview>
2+
<template>
3+
<jw-alert />
4+
</template>

src/views/doc/alert/index.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<template>
2+
<div class="alert-doc-wrapper">
3+
<h1>提示 Alert</h1>
4+
<p>用于页面中展示重要的提示信息。</p>
5+
<div class="preview-wrapper">
6+
<Preview :component="AlertPreview1"/>
7+
</div>
8+
</div>
9+
</template>
10+
11+
<script setup lang="ts">
12+
import Preview from '@/components/Preview.vue'
13+
import AlertPreview1 from './AlertPreview1.preview.vue'
14+
</script>
15+
16+
<style scoped>
17+
18+
</style>

0 commit comments

Comments
 (0)