lew-ui 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +5 -0
- package/.eslintrc.js +20 -0
- package/README.md +16 -0
- package/index.html +18 -0
- package/package.json +19 -12
- package/{components/base → packages/avatar}/LewAvatar.vue +0 -0
- package/packages/avatar/index.ts +9 -0
- package/{directives → packages/directives}/index.ts +0 -0
- package/{directives → packages/directives}/tooltips.ts +0 -0
- package/{hooks → packages/hooks}/index.ts +0 -0
- package/{hooks → packages/hooks}/useDOMCreate.ts +0 -0
- package/packages/index.ts +17 -0
- package/prettier.config.js +38 -0
- package/public/favicon.ico +0 -0
- package/src/App.vue +251 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/style/hljs.scss +86 -0
- package/src/assets/style/main.scss +87 -0
- package/src/assets/style/reset.scss +107 -0
- package/src/assets/style/var.scss +90 -0
- package/src/components/demo/DemoBox.vue +105 -0
- package/src/components/directive/lewTooltips.ts +23 -0
- package/{components → src/components}/feedback/LewAlert.vue +0 -0
- package/{components → src/components}/feedback/LewMessage.vue +0 -0
- package/{components → src/components}/feedback/LewModal.vue +1 -1
- package/{components → src/components}/form/LewCheckbox.vue +0 -0
- package/{components → src/components}/form/LewCheckboxGroup.vue +1 -1
- package/{components/form/FormItem.vue → src/components/form/LewFormItem.vue} +0 -0
- package/{components → src/components}/form/LewInput.vue +0 -0
- package/{components → src/components}/form/LewRadio.vue +0 -0
- package/{components → src/components}/form/LewRadioGroup.vue +1 -1
- package/{components → src/components}/form/LewSelect.vue +1 -1
- package/{components → src/components}/form/LewSwitch.vue +0 -0
- package/{components → src/components}/form/LewTabs.vue +0 -0
- package/{components → src/components}/form/LewTextarea.vue +0 -0
- package/src/components/general/LewAvatar.vue +107 -0
- package/{components/base → src/components/general}/LewBadge.vue +0 -0
- package/{components/base → src/components/general}/LewButton.vue +0 -0
- package/{components/base → src/components/general}/LewTitle.vue +0 -0
- package/src/components/hooks/useDOMCreate.ts +13 -0
- package/src/components/index.ts +37 -0
- package/src/components/layout/LewSiderbar.vue +98 -0
- package/src/env.d.ts +11 -0
- package/src/main.ts +22 -0
- package/src/router/index.ts +59 -0
- package/src/views/demo/feedback/LewAlert.vue +194 -0
- package/src/views/demo/feedback/LewDialog.vue +20 -0
- package/src/views/demo/feedback/LewMessage.vue +20 -0
- package/src/views/demo/feedback/LewModal.vue +127 -0
- package/src/views/demo/feedback/LewPopover.vue +20 -0
- package/src/views/demo/feedback/LewResult.vue +20 -0
- package/src/views/demo/feedback/LewTooltip.vue +164 -0
- package/src/views/demo/form/LewCascader.vue +24 -0
- package/src/views/demo/form/LewCheckbox.vue +158 -0
- package/src/views/demo/form/LewForm.vue +232 -0
- package/src/views/demo/form/LewInput.vue +55 -0
- package/src/views/demo/form/LewInputTag.vue +25 -0
- package/src/views/demo/form/LewRadio.vue +104 -0
- package/src/views/demo/form/LewSelect.vue +83 -0
- package/src/views/demo/form/LewSwitch.vue +61 -0
- package/src/views/demo/form/LewTabs.vue +75 -0
- package/src/views/demo/form/LewTextarea.vue +56 -0
- package/src/views/demo/general/LewAvatar copy.vue +58 -0
- package/src/views/demo/general/LewAvatar.vue +79 -0
- package/src/views/demo/general/LewBadge.vue +98 -0
- package/src/views/demo/general/LewButton.vue +66 -0
- package/src/views/demo/general/LewTitle.vue +47 -0
- package/tsconfig.json +18 -0
- package/tsconfig.node.json +8 -0
- package/vite.config.ts +16 -0
- package/vscode.setting.json +26 -0
- package/components/index.ts +0 -35
- package/index.ts +0 -3
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue';
|
|
3
|
+
import DemoBox from '../../../components/demo/DemoBox.vue';
|
|
4
|
+
import { LewTitle, LewSwitch } from '../../../components';
|
|
5
|
+
|
|
6
|
+
let value = ref(false);
|
|
7
|
+
|
|
8
|
+
const change = (e: unknown) => {
|
|
9
|
+
console.log(e);
|
|
10
|
+
console.log(value.value);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
let pre1 = ref(`<script setup lang="ts">
|
|
14
|
+
import { ref } from 'vue';
|
|
15
|
+
import { LewSwitch } from '../../../components';
|
|
16
|
+
|
|
17
|
+
let value = ref(false);
|
|
18
|
+
|
|
19
|
+
const change = (e: any) => {
|
|
20
|
+
console.log(e);
|
|
21
|
+
console.log(value.value);
|
|
22
|
+
};
|
|
23
|
+
<\/script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<LewSwitch v-model="value" @change="change"></LewSwitch>
|
|
27
|
+
</template>
|
|
28
|
+
`);
|
|
29
|
+
let pre2 = ref(`<script setup lang="ts">
|
|
30
|
+
import { ref } from 'vue';
|
|
31
|
+
import { LewSwitch } from '../../../components';
|
|
32
|
+
|
|
33
|
+
let value = ref(false);
|
|
34
|
+
|
|
35
|
+
const change = (e: any) => {
|
|
36
|
+
console.log(e);
|
|
37
|
+
console.log(value.value);
|
|
38
|
+
};
|
|
39
|
+
<\/script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<LewSwitch v-model="value" :round="false" @change="change"></LewSwitch>
|
|
43
|
+
</template>
|
|
44
|
+
`);
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<template>
|
|
48
|
+
<div class="demo-wrapper">
|
|
49
|
+
<lew-title>Switch</lew-title>
|
|
50
|
+
<demo-box title="圆的" :code="pre1">
|
|
51
|
+
<LewSwitch v-model="value" @change="change"></LewSwitch>
|
|
52
|
+
</demo-box>
|
|
53
|
+
<demo-box title="方的" :code="pre2">
|
|
54
|
+
<LewSwitch
|
|
55
|
+
v-model="value"
|
|
56
|
+
:round="false"
|
|
57
|
+
@change="change"
|
|
58
|
+
></LewSwitch>
|
|
59
|
+
</demo-box>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue';
|
|
3
|
+
import DemoBox from '../../../components/demo/DemoBox.vue';
|
|
4
|
+
import { LewTitle, LewTabs } from '../../../components';
|
|
5
|
+
|
|
6
|
+
const options = ref([
|
|
7
|
+
{ label: '北京', value: '1' },
|
|
8
|
+
{ label: '上海', value: '2' },
|
|
9
|
+
{ label: '广州', value: '3' },
|
|
10
|
+
{ label: '深圳', value: '4' },
|
|
11
|
+
{ label: '乌鲁木齐', value: '5' },
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
let value = ref('');
|
|
15
|
+
|
|
16
|
+
type Options = {
|
|
17
|
+
label: string;
|
|
18
|
+
value: string;
|
|
19
|
+
activeIndex: number;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const change = (e: Options) => {
|
|
23
|
+
console.log(e);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
let pre1 = ref(`<script setup lang="ts">
|
|
27
|
+
import { ref } from 'vue';
|
|
28
|
+
import { LewTabs } from '../../../components';
|
|
29
|
+
|
|
30
|
+
const options = ref([
|
|
31
|
+
{ label: '北京', value: '1' },
|
|
32
|
+
{ label: '上海', value: '2' },
|
|
33
|
+
{ label: '广州', value: '3' },
|
|
34
|
+
{ label: '深圳', value: '4' },
|
|
35
|
+
{ label: '乌鲁木齐', value: '5' },
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
let value = ref('');
|
|
39
|
+
|
|
40
|
+
type Options = {
|
|
41
|
+
label: string;
|
|
42
|
+
value: string;
|
|
43
|
+
activeIndex: number;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const change = (e: Options) => {
|
|
47
|
+
console.log(e);
|
|
48
|
+
};
|
|
49
|
+
<\/script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<div style="width: 450px">
|
|
53
|
+
<lew-tabs
|
|
54
|
+
v-model="value"
|
|
55
|
+
:options="options"
|
|
56
|
+
@update:change="change"
|
|
57
|
+
></lew-tabs>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
`);
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<template>
|
|
64
|
+
<div class="demo-wrapper">
|
|
65
|
+
<lew-title>Tabs</lew-title>
|
|
66
|
+
<demo-box title="常规" :code="pre1">
|
|
67
|
+
<div style="width: 450px">
|
|
68
|
+
<lew-tabs
|
|
69
|
+
v-model="value"
|
|
70
|
+
:options="options"
|
|
71
|
+
@update:change="change"
|
|
72
|
+
></lew-tabs></div
|
|
73
|
+
></demo-box>
|
|
74
|
+
</div>
|
|
75
|
+
</template>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import DemoBox from '../../../components/demo/DemoBox.vue';
|
|
3
|
+
import { ref } from 'vue';
|
|
4
|
+
import { LewTitle, LewFormItem, LewTextarea } from '../../../components';
|
|
5
|
+
let pre1 = ref(`<template>
|
|
6
|
+
<div style="width: 300px">
|
|
7
|
+
<lew-form-item title="账号">
|
|
8
|
+
<LewTextarea resize="vertical"/>
|
|
9
|
+
</lew-form-item>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
`);
|
|
13
|
+
let pre2 = ref(`<template>
|
|
14
|
+
<div style="width: 300px">
|
|
15
|
+
<lew-form-item title="账号">
|
|
16
|
+
<LewTextarea resize="vertical" />
|
|
17
|
+
</lew-form-item>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
`);
|
|
21
|
+
let pre3 = ref(`<template>
|
|
22
|
+
<div style="width: 300px">
|
|
23
|
+
<lew-form-item title="账号">
|
|
24
|
+
<LewTextarea resize="none" />
|
|
25
|
+
</lew-form-item>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
`);
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<div class="demo-wrapper">
|
|
33
|
+
<lew-title>Textera</lew-title>
|
|
34
|
+
<demo-box title="x 布局" :code="pre1">
|
|
35
|
+
<div style="width: 300px">
|
|
36
|
+
<lew-form-item title="账号">
|
|
37
|
+
<LewTextarea resize="vertical" />
|
|
38
|
+
</lew-form-item>
|
|
39
|
+
</div>
|
|
40
|
+
</demo-box>
|
|
41
|
+
<demo-box title="y 布局" :code="pre2">
|
|
42
|
+
<div style="width: 300px">
|
|
43
|
+
<lew-form-item title="账号" direction="y">
|
|
44
|
+
<LewTextarea resize="vertical" />
|
|
45
|
+
</lew-form-item>
|
|
46
|
+
</div>
|
|
47
|
+
</demo-box>
|
|
48
|
+
<demo-box title="禁止缩放" :code="pre3">
|
|
49
|
+
<div style="width: 300px">
|
|
50
|
+
<lew-form-item title="账号">
|
|
51
|
+
<LewTextarea resize="none" />
|
|
52
|
+
</lew-form-item>
|
|
53
|
+
</div>
|
|
54
|
+
</demo-box>
|
|
55
|
+
</div>
|
|
56
|
+
</template>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue';
|
|
3
|
+
import {
|
|
4
|
+
LewTitle,
|
|
5
|
+
LewButton,
|
|
6
|
+
LewModal,
|
|
7
|
+
LewInput,
|
|
8
|
+
LewFormItem,
|
|
9
|
+
} from '../../../components';
|
|
10
|
+
|
|
11
|
+
const modalVisible = ref(false);
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<lew-button @click="modalVisible = true">登录</lew-button>
|
|
16
|
+
<lew-modal
|
|
17
|
+
:visible="modalVisible"
|
|
18
|
+
width="350px"
|
|
19
|
+
@mask-click="modalVisible = false"
|
|
20
|
+
>
|
|
21
|
+
<div class="modal-body">
|
|
22
|
+
<lew-title :bold="700" style="margin-bottom: 20px"
|
|
23
|
+
>登录你的账户</lew-title
|
|
24
|
+
>
|
|
25
|
+
<lew-form-item direction="y" title="账号">
|
|
26
|
+
<lew-input
|
|
27
|
+
/></lew-form-item>
|
|
28
|
+
<lew-form-item
|
|
29
|
+
style="margin-bottom: 30px"
|
|
30
|
+
direction="y"
|
|
31
|
+
title="密码"
|
|
32
|
+
>
|
|
33
|
+
<lew-input
|
|
34
|
+
/></lew-form-item>
|
|
35
|
+
|
|
36
|
+
<div>
|
|
37
|
+
<lew-button
|
|
38
|
+
type="normal"
|
|
39
|
+
style="margin-right: 20px"
|
|
40
|
+
@click="modalVisible = false"
|
|
41
|
+
>关闭</lew-button
|
|
42
|
+
>
|
|
43
|
+
<lew-button @click="modalVisible = false">立即登录</lew-button>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</lew-modal>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<style lang="scss" scoped>
|
|
50
|
+
.modal-body {
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 100%;
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
padding: 40px;
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
}
|
|
58
|
+
</style>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import DemoBox from '../../../components/demo/DemoBox.vue';
|
|
3
|
+
import { LewTitle, LewAvatar } from '../../../components';
|
|
4
|
+
|
|
5
|
+
import { ref } from 'vue';
|
|
6
|
+
|
|
7
|
+
let avatarUrl = ref(
|
|
8
|
+
'https://cdn.jsdelivr.net/gh/lewkamtao/PicHub-Cloud@master/PicHub/1fb3f5f5bf661efd985d940004b3642_pyapiq_.jpeg',
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
let pre1 = ref(`<template>
|
|
12
|
+
<lew-avatar style="margin-right: 20px" :src="avatarUrl" alt="avatar" />
|
|
13
|
+
<lew-avatar style="margin-right: 20px" round :src="avatarUrl" alt="avatar" />
|
|
14
|
+
</template>`);
|
|
15
|
+
|
|
16
|
+
let pre2 = ref(`<template>
|
|
17
|
+
<lew-avatar :src="avatarUrl" status="online" status-position="top-left" />
|
|
18
|
+
<lew-avatar :src="avatarUrl" status="busy" status-position="top-right" />
|
|
19
|
+
<lew-avatar
|
|
20
|
+
:src="avatarUrl"
|
|
21
|
+
round
|
|
22
|
+
status="away"
|
|
23
|
+
status-position="bottom-left"
|
|
24
|
+
/>
|
|
25
|
+
<lew-avatar
|
|
26
|
+
:src="avatarUrl"
|
|
27
|
+
round
|
|
28
|
+
status="offline"
|
|
29
|
+
status-position="bottom-right"
|
|
30
|
+
/>
|
|
31
|
+
</template>
|
|
32
|
+
`);
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<div class="demo-wrapper">
|
|
37
|
+
<lew-title>Avatar</lew-title>
|
|
38
|
+
<demo-box title="普通" :code="pre1">
|
|
39
|
+
<lew-avatar
|
|
40
|
+
style="margin-right: 20px"
|
|
41
|
+
:src="avatarUrl"
|
|
42
|
+
alt="avatar" />
|
|
43
|
+
<lew-avatar
|
|
44
|
+
style="margin-right: 20px"
|
|
45
|
+
round
|
|
46
|
+
:src="avatarUrl"
|
|
47
|
+
alt="avatar"
|
|
48
|
+
/></demo-box>
|
|
49
|
+
<demo-box title="普通" :code="pre2">
|
|
50
|
+
<lew-avatar
|
|
51
|
+
style="margin-right: 20px"
|
|
52
|
+
:src="avatarUrl"
|
|
53
|
+
status="online"
|
|
54
|
+
status-position="top-left" />
|
|
55
|
+
<lew-avatar
|
|
56
|
+
style="margin-right: 20px"
|
|
57
|
+
:src="avatarUrl"
|
|
58
|
+
status="busy"
|
|
59
|
+
status-position="top-right" />
|
|
60
|
+
<lew-avatar
|
|
61
|
+
style="margin-right: 20px"
|
|
62
|
+
:src="avatarUrl"
|
|
63
|
+
round
|
|
64
|
+
status="away"
|
|
65
|
+
status-position="bottom-left" />
|
|
66
|
+
<lew-avatar
|
|
67
|
+
:src="avatarUrl"
|
|
68
|
+
round
|
|
69
|
+
status="offline"
|
|
70
|
+
status-position="bottom-right"
|
|
71
|
+
/></demo-box>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<style lang="scss" scoped>
|
|
76
|
+
.lew-avatar {
|
|
77
|
+
margin: 10px;
|
|
78
|
+
}
|
|
79
|
+
</style>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import DemoBox from '../../../components/demo/DemoBox.vue';
|
|
3
|
+
import { LewTitle, LewBadge } from '../../../components';
|
|
4
|
+
import { ref } from 'vue';
|
|
5
|
+
let pre1 = ref(`<template>
|
|
6
|
+
<lew-badge type="primary">primary</lew-badge>
|
|
7
|
+
<lew-badge type="success">success</lew-badge>
|
|
8
|
+
<lew-badge type="danger">danger</lew-badge>
|
|
9
|
+
<lew-badge type="warning">waning</lew-badge>
|
|
10
|
+
<lew-badge type="normal">normal</lew-badge>
|
|
11
|
+
</template>
|
|
12
|
+
`);
|
|
13
|
+
let pre2 = ref(`<template>
|
|
14
|
+
<lew-badge round type="primary">primary</lew-badge>
|
|
15
|
+
<lew-badge round type="success">success</lew-badge>
|
|
16
|
+
<lew-badge round type="danger">danger</lew-badge>
|
|
17
|
+
<lew-badge round type="warning">waning</lew-badge>
|
|
18
|
+
<lew-badge round type="normal">normal</lew-badge>
|
|
19
|
+
</template>
|
|
20
|
+
`);
|
|
21
|
+
let pre3 = ref(`<template>
|
|
22
|
+
<lew-badge round :bold="700" type="primary">primary</lew-badge>
|
|
23
|
+
<lew-badge round :bold="700" type="success">success</lew-badge>
|
|
24
|
+
<lew-badge round :bold="700" type="danger">danger</lew-badge>
|
|
25
|
+
<lew-badge round :bold="700" type="warning">waning</lew-badge>
|
|
26
|
+
<lew-badge round :bold="700" type="normal">normal</lew-badge>
|
|
27
|
+
<lew-badge round :bold="700" type="primary">15</lew-badge>
|
|
28
|
+
<lew-badge round :bold="700" type="danger">99+</lew-badge>
|
|
29
|
+
<lew-badge round :bold="700" type="success">3</lew-badge>
|
|
30
|
+
</template>
|
|
31
|
+
`);
|
|
32
|
+
let pre4 = ref(`<template>
|
|
33
|
+
<lew-badge round type="primary" href="/button">BUTTON</lew-badge>
|
|
34
|
+
<lew-badge round type="normal" href="https://vuejs.org/">Vue</lew-badge>
|
|
35
|
+
</template>
|
|
36
|
+
`);
|
|
37
|
+
let pre5 = ref(`<template>
|
|
38
|
+
<lew-badge round dot type="normal"></lew-badge>
|
|
39
|
+
<lew-badge round dot type="primary"></lew-badge>
|
|
40
|
+
<lew-badge round dot type="success"></lew-badge>
|
|
41
|
+
<lew-badge round dot type="warning"></lew-badge>
|
|
42
|
+
<lew-badge round dot type="danger"></lew-badge>
|
|
43
|
+
</template>
|
|
44
|
+
`);
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<template>
|
|
48
|
+
<div class="demo-wrapper">
|
|
49
|
+
<lew-title>Badge</lew-title>
|
|
50
|
+
<demo-box title="普通" :code="pre1">
|
|
51
|
+
<lew-badge type="primary">primary</lew-badge>
|
|
52
|
+
<lew-badge type="success">success</lew-badge>
|
|
53
|
+
<lew-badge type="danger">danger</lew-badge>
|
|
54
|
+
<lew-badge type="warning">waning</lew-badge>
|
|
55
|
+
<lew-badge type="normal">normal</lew-badge>
|
|
56
|
+
</demo-box>
|
|
57
|
+
<demo-box title="圆形" :code="pre2">
|
|
58
|
+
<lew-badge round type="primary">primary</lew-badge>
|
|
59
|
+
<lew-badge round type="success">success</lew-badge>
|
|
60
|
+
<lew-badge round type="danger">danger</lew-badge>
|
|
61
|
+
<lew-badge round type="warning">waning</lew-badge>
|
|
62
|
+
<lew-badge round type="normal">normal</lew-badge>
|
|
63
|
+
</demo-box>
|
|
64
|
+
<demo-box title="粗的" :code="pre3">
|
|
65
|
+
<lew-badge round :bold="700" type="primary">primary</lew-badge>
|
|
66
|
+
<lew-badge round :bold="700" type="success">success</lew-badge>
|
|
67
|
+
<lew-badge round :bold="700" type="danger">danger</lew-badge>
|
|
68
|
+
<lew-badge round :bold="700" type="warning">waning</lew-badge>
|
|
69
|
+
<lew-badge round :bold="700" type="normal">normal</lew-badge>
|
|
70
|
+
<lew-badge round :bold="700" type="primary">15</lew-badge>
|
|
71
|
+
<lew-badge round :bold="700" type="danger">99+</lew-badge>
|
|
72
|
+
<lew-badge round :bold="700" type="success">3</lew-badge>
|
|
73
|
+
</demo-box>
|
|
74
|
+
<demo-box title="链接" :code="pre4">
|
|
75
|
+
<lew-badge round type="primary" href="/button">BUTTON</lew-badge>
|
|
76
|
+
<lew-badge round type="normal" href="https://vuejs.org/"
|
|
77
|
+
>Vue</lew-badge
|
|
78
|
+
>
|
|
79
|
+
</demo-box>
|
|
80
|
+
<demo-box title="点" :code="pre5">
|
|
81
|
+
<lew-badge round dot type="normal"></lew-badge>
|
|
82
|
+
<lew-badge round dot type="primary"></lew-badge>
|
|
83
|
+
<lew-badge round dot type="success"></lew-badge>
|
|
84
|
+
<lew-badge round dot type="warning"></lew-badge>
|
|
85
|
+
<lew-badge round dot type="danger"></lew-badge>
|
|
86
|
+
</demo-box>
|
|
87
|
+
</div>
|
|
88
|
+
</template>
|
|
89
|
+
|
|
90
|
+
<style lang="scss" scoped>
|
|
91
|
+
.main {
|
|
92
|
+
width: 100%;
|
|
93
|
+
margin: 0 auto;
|
|
94
|
+
> div {
|
|
95
|
+
margin-bottom: 40px;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
</style>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import DemoBox from '../../../components/demo/DemoBox.vue';
|
|
3
|
+
import { LewTitle, LewButton } from '../../../components';
|
|
4
|
+
import { ref } from 'vue';
|
|
5
|
+
let pre1 = ref(`<template>
|
|
6
|
+
<lew-button type="primary">确定</lew-button>
|
|
7
|
+
<lew-button type="danger">危险</lew-button>
|
|
8
|
+
<lew-button type="warning">警告</lew-button>
|
|
9
|
+
<lew-button type="normal">这是一个长按钮</lew-button>
|
|
10
|
+
<lew-button type="success">确定</lew-button>
|
|
11
|
+
</template>
|
|
12
|
+
`);
|
|
13
|
+
let pre2 = ref(`<template>
|
|
14
|
+
<lew-button round type="primary">确定</lew-button>
|
|
15
|
+
<lew-button round type="danger">危险</lew-button>
|
|
16
|
+
<lew-button round type="warning">警告</lew-button>
|
|
17
|
+
<lew-button round type="normal">这是一个长按钮</lew-button>
|
|
18
|
+
<lew-button round type="success">确定</lew-button>
|
|
19
|
+
</template>
|
|
20
|
+
`);
|
|
21
|
+
let pre3 = ref(`<template>
|
|
22
|
+
<lew-button type="primary" loading>确定</lew-button>
|
|
23
|
+
<lew-button type="success" round loading>确定</lew-button>
|
|
24
|
+
</template>
|
|
25
|
+
`);
|
|
26
|
+
let pre4 = ref(`<template>
|
|
27
|
+
<lew-button type="success" loading disabled>确定</lew-button>
|
|
28
|
+
</template>
|
|
29
|
+
`);
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<div class="demo-wrapper">
|
|
34
|
+
<lew-title>Button</lew-title>
|
|
35
|
+
|
|
36
|
+
<demo-box title="普通" :code="pre1">
|
|
37
|
+
<lew-button type="primary">确定</lew-button>
|
|
38
|
+
<lew-button type="danger">危险</lew-button>
|
|
39
|
+
<lew-button type="warning">警告</lew-button>
|
|
40
|
+
<lew-button type="normal">这是一个长按钮</lew-button>
|
|
41
|
+
<lew-button type="success">确定</lew-button></demo-box
|
|
42
|
+
>
|
|
43
|
+
<demo-box title="圆型" :code="pre2">
|
|
44
|
+
<lew-button round type="primary">确定</lew-button>
|
|
45
|
+
<lew-button round type="danger">危险</lew-button>
|
|
46
|
+
<lew-button round type="warning">警告</lew-button>
|
|
47
|
+
<lew-button round type="normal">这是一个长按钮</lew-button>
|
|
48
|
+
<lew-button round type="success">确定</lew-button></demo-box
|
|
49
|
+
>
|
|
50
|
+
<demo-box title="加载" :code="pre3">
|
|
51
|
+
<lew-button type="primary" loading>确定</lew-button>
|
|
52
|
+
<lew-button type="success" round loading>确定</lew-button></demo-box
|
|
53
|
+
>
|
|
54
|
+
<demo-box title="禁用" :code="pre4">
|
|
55
|
+
<lew-button type="success" loading disabled
|
|
56
|
+
>确定</lew-button
|
|
57
|
+
></demo-box
|
|
58
|
+
>
|
|
59
|
+
</div>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<style lang="scss" scoped>
|
|
63
|
+
.lew-button {
|
|
64
|
+
margin: 10px;
|
|
65
|
+
}
|
|
66
|
+
</style>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import DemoBox from '../../../components/demo/DemoBox.vue';
|
|
3
|
+
import { LewTitle } from '../../../components';
|
|
4
|
+
import { ref } from 'vue';
|
|
5
|
+
let pre1 = ref(`<template>
|
|
6
|
+
<lew-title :bold="400" size="14px">14px 常规</lew-title>
|
|
7
|
+
<lew-title :bold="400" size="16px">16px 常规</lew-title>
|
|
8
|
+
<lew-title :bold="400" size="18px">18px 常规</lew-title>
|
|
9
|
+
<lew-title :bold="400" size="22px">22px 常规</lew-title>
|
|
10
|
+
<lew-title :bold="400" size="26px">26px 常规</lew-title>
|
|
11
|
+
</template>
|
|
12
|
+
`);
|
|
13
|
+
let pre2 = ref(`<template>
|
|
14
|
+
<lew-title size="14px" :bold="800">14px 粗体</lew-title>
|
|
15
|
+
<lew-title size="16px" :bold="800">16px 粗体</lew-title>
|
|
16
|
+
<lew-title size="18px" :bold="800">18px 粗体</lew-title>
|
|
17
|
+
<lew-title size="22px" :bold="800">22px 粗体</lew-title>
|
|
18
|
+
<lew-title size="26px" :bold="800">26px 粗体</lew-title>
|
|
19
|
+
</template>
|
|
20
|
+
`);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div class="demo-wrapper">
|
|
25
|
+
<lew-title>Title</lew-title>
|
|
26
|
+
<demo-box title="普通" :code="pre1">
|
|
27
|
+
<lew-title :bold="400" size="14px">14px 常规</lew-title>
|
|
28
|
+
<lew-title :bold="400" size="16px">16px 常规</lew-title>
|
|
29
|
+
<lew-title :bold="400" size="18px">18px 常规</lew-title>
|
|
30
|
+
<lew-title :bold="400" size="22px">22px 常规</lew-title>
|
|
31
|
+
<lew-title :bold="400" size="26px">26px 常规</lew-title></demo-box
|
|
32
|
+
>
|
|
33
|
+
<demo-box title="粗体" :code="pre2">
|
|
34
|
+
<lew-title size="14px" :bold="800">14px 粗体</lew-title>
|
|
35
|
+
<lew-title size="16px" :bold="800">16px 粗体</lew-title>
|
|
36
|
+
<lew-title size="18px" :bold="800">18px 粗体</lew-title>
|
|
37
|
+
<lew-title size="22px" :bold="800">22px 粗体</lew-title>
|
|
38
|
+
<lew-title size="26px" :bold="800">26px 粗体</lew-title></demo-box
|
|
39
|
+
>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<style lang="scss" scoped>
|
|
44
|
+
.lew-title {
|
|
45
|
+
margin-bottom: 20px;
|
|
46
|
+
}
|
|
47
|
+
</style>
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "esnext",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "esnext",
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"jsx": "preserve",
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"lib": ["esnext", "dom"],
|
|
14
|
+
"skipLibCheck": true
|
|
15
|
+
},
|
|
16
|
+
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "src/components/feedback/directive.js"],
|
|
17
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
18
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import vue from '@vitejs/plugin-vue';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
|
|
5
|
+
// https://vitejs.dev/config/
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
resolve: {
|
|
8
|
+
//设置别名
|
|
9
|
+
alias: {
|
|
10
|
+
'@': path.resolve(__dirname, 'src'),
|
|
11
|
+
},
|
|
12
|
+
// 忽略后缀名的配置选项, 添加 .vue 选项时要记得原本默认忽略的选项也要手动写入
|
|
13
|
+
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
|
|
14
|
+
},
|
|
15
|
+
plugins: [vue()],
|
|
16
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"[vue]": {
|
|
3
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
4
|
+
},
|
|
5
|
+
"[json]": {
|
|
6
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
"editor.rulers": [],
|
|
10
|
+
"[jsonc]": {
|
|
11
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
12
|
+
},
|
|
13
|
+
"eslint.nodePath": "",
|
|
14
|
+
"[javascript]": {
|
|
15
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
16
|
+
},
|
|
17
|
+
"eslint.nodeEnv": "",
|
|
18
|
+
"explorer.confirmDelete": false,
|
|
19
|
+
"workbench.iconTheme": "vscode-icons",
|
|
20
|
+
"[typescript]": {
|
|
21
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
22
|
+
},
|
|
23
|
+
"settingsSync.ignoredSettings": [],
|
|
24
|
+
"git.enableSmartCommit": true,
|
|
25
|
+
"editor.codeActionsOnSave": {}
|
|
26
|
+
}
|
package/components/index.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import LewAvatar from './base/Avatar.vue';
|
|
2
|
-
import LewButton from './base/Button.vue';
|
|
3
|
-
import LewBadge from './base/Badge.vue';
|
|
4
|
-
import LewTitle from './base/Title.vue';
|
|
5
|
-
import LewFormItem from './form/FormItem.vue';
|
|
6
|
-
import LewInput from './form/Input.vue';
|
|
7
|
-
import LewSelect from './form/Select.vue';
|
|
8
|
-
import LewSwitch from './form/Switch.vue';
|
|
9
|
-
import LewTextarea from './form/Textarea.vue';
|
|
10
|
-
import LewCheckbox from './form/Checkbox.vue';
|
|
11
|
-
import LewCheckboxGroup from './form/CheckboxGroup.vue';
|
|
12
|
-
import LewRadio from './form/Radio.vue';
|
|
13
|
-
import LewRadioGroup from './form/RadioGroup.vue';
|
|
14
|
-
import LewTabs from './form/Tabs.vue';
|
|
15
|
-
import LewAlert from './feedback/Alert.vue';
|
|
16
|
-
import LewModal from './feedback/Modal.vue';
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
LewButton,
|
|
20
|
-
LewFormItem,
|
|
21
|
-
LewInput,
|
|
22
|
-
LewSelect,
|
|
23
|
-
LewSwitch,
|
|
24
|
-
LewTitle,
|
|
25
|
-
LewTabs,
|
|
26
|
-
LewBadge,
|
|
27
|
-
LewAvatar,
|
|
28
|
-
LewTextarea,
|
|
29
|
-
LewCheckbox,
|
|
30
|
-
LewCheckboxGroup,
|
|
31
|
-
LewRadio,
|
|
32
|
-
LewRadioGroup,
|
|
33
|
-
LewAlert,
|
|
34
|
-
LewModal,
|
|
35
|
-
};
|
package/index.ts
DELETED