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,158 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import DemoBox from '../../../components/demo/DemoBox.vue';
|
|
3
|
+
import { ref } from 'vue';
|
|
4
|
+
import { LewTitle, LewCheckboxGroup } from '../../../components';
|
|
5
|
+
|
|
6
|
+
let options = ref([
|
|
7
|
+
{ name: '宋朝', id: 1 },
|
|
8
|
+
{ name: '唐朝', id: 2 },
|
|
9
|
+
{ name: '明朝', id: 3 },
|
|
10
|
+
{ name: '清朝', id: 4 },
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
let value = ref([]);
|
|
14
|
+
|
|
15
|
+
let pre1 = ref(`<script setup lang="ts">
|
|
16
|
+
import { ref } from 'vue';
|
|
17
|
+
import { LewCheckboxGroup } from '../../../components';
|
|
18
|
+
// 定义选项
|
|
19
|
+
let options = ref([
|
|
20
|
+
{ name: '宋朝', id: 1 },
|
|
21
|
+
{ name: '唐朝', id: 2 },
|
|
22
|
+
{ name: '明朝', id: 3 },
|
|
23
|
+
{ name: '清朝', id: 4 },
|
|
24
|
+
]);
|
|
25
|
+
// 值
|
|
26
|
+
let value = ref([]);
|
|
27
|
+
<\/script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<lew-checkbox-group
|
|
31
|
+
v-model="value"
|
|
32
|
+
direction="x"
|
|
33
|
+
:options="options"
|
|
34
|
+
></lew-checkbox-group>
|
|
35
|
+
</template>
|
|
36
|
+
`);
|
|
37
|
+
let pre2 = ref(`<script setup lang="ts">
|
|
38
|
+
import { ref } from 'vue';
|
|
39
|
+
import { LewCheckboxGroup } from '../../../components';
|
|
40
|
+
// 定义选项
|
|
41
|
+
let options = ref([
|
|
42
|
+
{ name: '宋朝', id: 1 },
|
|
43
|
+
{ name: '唐朝', id: 2 },
|
|
44
|
+
{ name: '明朝', id: 3 },
|
|
45
|
+
{ name: '清朝', id: 4 },
|
|
46
|
+
]);
|
|
47
|
+
// 值
|
|
48
|
+
let value = ref([]);
|
|
49
|
+
<\/script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<lew-checkbox-group
|
|
53
|
+
v-model="value"
|
|
54
|
+
direction="y"
|
|
55
|
+
round
|
|
56
|
+
:options="options"
|
|
57
|
+
></lew-checkbox-group>
|
|
58
|
+
</template>
|
|
59
|
+
`);
|
|
60
|
+
let pre3 = ref(`<script setup lang="ts">
|
|
61
|
+
import { ref } from 'vue';
|
|
62
|
+
import { LewCheckboxGroup } from '../../../components';
|
|
63
|
+
// 定义选项
|
|
64
|
+
let options = ref([
|
|
65
|
+
{ name: '宋朝', id: 1 },
|
|
66
|
+
{ name: '唐朝', id: 2 },
|
|
67
|
+
{ name: '明朝', id: 3 },
|
|
68
|
+
{ name: '清朝', id: 4 },
|
|
69
|
+
]);
|
|
70
|
+
// 值
|
|
71
|
+
let value = ref([]);
|
|
72
|
+
<\/script>
|
|
73
|
+
|
|
74
|
+
<template>
|
|
75
|
+
<lew-checkbox-group
|
|
76
|
+
v-model="value"
|
|
77
|
+
block
|
|
78
|
+
direction="x"
|
|
79
|
+
:options="options"
|
|
80
|
+
></lew-checkbox-group>
|
|
81
|
+
</template>
|
|
82
|
+
`);
|
|
83
|
+
let pre4 = ref(`<script setup lang="ts">
|
|
84
|
+
import { ref } from 'vue';
|
|
85
|
+
import { LewCheckboxGroup } from '../../../components';
|
|
86
|
+
// 定义选项
|
|
87
|
+
let options = ref([
|
|
88
|
+
{ name: '宋朝', id: 1 },
|
|
89
|
+
{ name: '唐朝', id: 2 },
|
|
90
|
+
{ name: '明朝', id: 3 },
|
|
91
|
+
{ name: '清朝', id: 4 },
|
|
92
|
+
]);
|
|
93
|
+
// 值
|
|
94
|
+
let value = ref([]);
|
|
95
|
+
<\/script>
|
|
96
|
+
|
|
97
|
+
<template>
|
|
98
|
+
<lew-checkbox-group
|
|
99
|
+
v-model="value"
|
|
100
|
+
block
|
|
101
|
+
round
|
|
102
|
+
direction="x"
|
|
103
|
+
:options="options"
|
|
104
|
+
></lew-checkbox-group>
|
|
105
|
+
</template>
|
|
106
|
+
`);
|
|
107
|
+
</script>
|
|
108
|
+
|
|
109
|
+
<template>
|
|
110
|
+
<div class="demo-wrapper">
|
|
111
|
+
<lew-title>Checkbox</lew-title>
|
|
112
|
+
<demo-box title="x 布局" badge="方的" :code="pre1">
|
|
113
|
+
<lew-checkbox-group
|
|
114
|
+
v-model="value"
|
|
115
|
+
direction="x"
|
|
116
|
+
:options="options"
|
|
117
|
+
></lew-checkbox-group>
|
|
118
|
+
</demo-box>
|
|
119
|
+
|
|
120
|
+
<demo-box title="y 布局" badge="圆的" :code="pre2">
|
|
121
|
+
<lew-checkbox-group
|
|
122
|
+
v-model="value"
|
|
123
|
+
direction="y"
|
|
124
|
+
round
|
|
125
|
+
:options="options"
|
|
126
|
+
></lew-checkbox-group>
|
|
127
|
+
</demo-box>
|
|
128
|
+
|
|
129
|
+
<demo-box title="块" :code="pre3" badge="方的">
|
|
130
|
+
<lew-checkbox-group
|
|
131
|
+
v-model="value"
|
|
132
|
+
block
|
|
133
|
+
direction="x"
|
|
134
|
+
:options="options"
|
|
135
|
+
></lew-checkbox-group>
|
|
136
|
+
</demo-box>
|
|
137
|
+
<demo-box title="块" :code="pre4" badge="圆的">
|
|
138
|
+
<lew-checkbox-group
|
|
139
|
+
v-model="value"
|
|
140
|
+
block
|
|
141
|
+
round
|
|
142
|
+
direction="x"
|
|
143
|
+
:options="options"
|
|
144
|
+
></lew-checkbox-group>
|
|
145
|
+
</demo-box>
|
|
146
|
+
</div>
|
|
147
|
+
</template>
|
|
148
|
+
|
|
149
|
+
<style lang="scss" scoped>
|
|
150
|
+
.main {
|
|
151
|
+
width: 100%;
|
|
152
|
+
margin: 0 auto;
|
|
153
|
+
|
|
154
|
+
> div {
|
|
155
|
+
margin: 30px 0px;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
</style>
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import DemoBox from '../../../components/demo/DemoBox.vue';
|
|
3
|
+
import { ref } from 'vue';
|
|
4
|
+
import {
|
|
5
|
+
LewTitle,
|
|
6
|
+
LewInput,
|
|
7
|
+
LewFormItem,
|
|
8
|
+
LewCheckboxGroup,
|
|
9
|
+
LewRadioboxGroup,
|
|
10
|
+
LewSwitch,
|
|
11
|
+
LewTextarea,
|
|
12
|
+
LewSelect,
|
|
13
|
+
LewTabs,
|
|
14
|
+
} from '../../../components';
|
|
15
|
+
|
|
16
|
+
let user = ref({
|
|
17
|
+
username: '',
|
|
18
|
+
password: '',
|
|
19
|
+
age: '',
|
|
20
|
+
sex: 0,
|
|
21
|
+
hobby: [],
|
|
22
|
+
school: '',
|
|
23
|
+
home: '',
|
|
24
|
+
dark: true,
|
|
25
|
+
pay: '',
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
let sex_options = ref([
|
|
29
|
+
{ name: '未知', id: 0 },
|
|
30
|
+
{ name: '男', id: 1 },
|
|
31
|
+
{ name: '女', id: 2 },
|
|
32
|
+
]);
|
|
33
|
+
|
|
34
|
+
let pay_options = ref([
|
|
35
|
+
{ label: '微信', value: '1' },
|
|
36
|
+
{ label: '支付宝', value: '2' },
|
|
37
|
+
{ label: 'Apple Pay', value: '3' },
|
|
38
|
+
]);
|
|
39
|
+
let hobby_options = ref([
|
|
40
|
+
{ name: '唱歌', id: 1 },
|
|
41
|
+
{ name: '跳舞', id: 2 },
|
|
42
|
+
{ name: 'rap', id: 3 },
|
|
43
|
+
{ name: '打篮球', id: 44 },
|
|
44
|
+
]);
|
|
45
|
+
let home_options = ref([
|
|
46
|
+
{
|
|
47
|
+
label: '广东',
|
|
48
|
+
value: '1',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: '深圳',
|
|
52
|
+
value: '2',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: '杭州',
|
|
56
|
+
value: '3',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: '上海',
|
|
60
|
+
value: '4',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: '北京',
|
|
64
|
+
value: '5',
|
|
65
|
+
},
|
|
66
|
+
]);
|
|
67
|
+
|
|
68
|
+
let pre1 = ref(`<script setup lang="ts">
|
|
69
|
+
import { ref } from 'vue';
|
|
70
|
+
import {
|
|
71
|
+
LewInput,
|
|
72
|
+
LewFormItem,
|
|
73
|
+
LewCheckboxGroup,
|
|
74
|
+
LewRadioboxGroup,
|
|
75
|
+
LewSwitch,
|
|
76
|
+
LewTextarea,
|
|
77
|
+
LewSelect,
|
|
78
|
+
LewTabs,
|
|
79
|
+
} from '../../../components';
|
|
80
|
+
|
|
81
|
+
let user = ref({
|
|
82
|
+
username: '',
|
|
83
|
+
password: '',
|
|
84
|
+
age: '',
|
|
85
|
+
sex: 0,
|
|
86
|
+
hobby: [],
|
|
87
|
+
school: '',
|
|
88
|
+
home: '',
|
|
89
|
+
dark: true,
|
|
90
|
+
pay: '',
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
let sex_options = ref([
|
|
94
|
+
{ name: '未知', id: 0 },
|
|
95
|
+
{ name: '男', id: 1 },
|
|
96
|
+
{ name: '女', id: 2 },
|
|
97
|
+
]);
|
|
98
|
+
|
|
99
|
+
let pay_options = ref([
|
|
100
|
+
{ label: '微信', value: '1' },
|
|
101
|
+
{ label: '支付宝', value: '2' },
|
|
102
|
+
{ label: 'Apple Pay', value: '3' },
|
|
103
|
+
]);
|
|
104
|
+
|
|
105
|
+
let hobby_options = ref([
|
|
106
|
+
{ name: '唱歌', id: 1 },
|
|
107
|
+
{ name: '跳舞', id: 2 },
|
|
108
|
+
{ name: 'rap', id: 3 },
|
|
109
|
+
{ name: '打篮球', id: 44 },
|
|
110
|
+
]);
|
|
111
|
+
|
|
112
|
+
let home_options = ref([
|
|
113
|
+
{
|
|
114
|
+
label: '广东',
|
|
115
|
+
value: '1',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
label: '深圳',
|
|
119
|
+
value: '2',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
label: '杭州',
|
|
123
|
+
value: '3',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
label: '上海',
|
|
127
|
+
value: '4',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
label: '北京',
|
|
131
|
+
value: '5',
|
|
132
|
+
},
|
|
133
|
+
]);
|
|
134
|
+
<\/script>
|
|
135
|
+
|
|
136
|
+
<template>
|
|
137
|
+
<div class="form-box">
|
|
138
|
+
<lew-form-item direction="y" title="账号">
|
|
139
|
+
<LewInput
|
|
140
|
+
v-tooltip="{
|
|
141
|
+
content: "输入账号",
|
|
142
|
+
placement: "top",
|
|
143
|
+
trigger: "focus",
|
|
144
|
+
}"
|
|
145
|
+
v-model="user.username"
|
|
146
|
+
/>
|
|
147
|
+
</lew-form-item>
|
|
148
|
+
<lew-form-item direction="y" title="密码">
|
|
149
|
+
<LewInput v-model="user.password" />
|
|
150
|
+
</lew-form-item>
|
|
151
|
+
<lew-form-item direction="y" title="简介">
|
|
152
|
+
<LewTextarea v-model="user.password" resize="none" />
|
|
153
|
+
</lew-form-item>
|
|
154
|
+
<lew-form-item direction="y" title="家地址">
|
|
155
|
+
<LewSelect v-model="user.home" :options="home_options" />
|
|
156
|
+
</lew-form-item>
|
|
157
|
+
<lew-form-item direction="y" title="性别">
|
|
158
|
+
<lew-radiobox-group v-model="user.sex" :options="sex_options" />
|
|
159
|
+
</lew-form-item>
|
|
160
|
+
<lew-form-item direction="y" title="爱好">
|
|
161
|
+
<lew-checkbox-group v-model="user.hobby" :options="hobby_options" />
|
|
162
|
+
</lew-form-item>
|
|
163
|
+
<lew-form-item direction="y" title="订阅">
|
|
164
|
+
<LewSwitch v-model="user.dark" />
|
|
165
|
+
</lew-form-item>
|
|
166
|
+
<lew-form-item direction="y" title="爱好">
|
|
167
|
+
<lew-tabs v-model="user.pay" :options="pay_options" />
|
|
168
|
+
</lew-form-item>
|
|
169
|
+
</div>
|
|
170
|
+
</template>
|
|
171
|
+
|
|
172
|
+
<style lang="scss" scoped>
|
|
173
|
+
.form-box {
|
|
174
|
+
width: 500px;
|
|
175
|
+
margin: 50px auto;
|
|
176
|
+
}
|
|
177
|
+
</style>
|
|
178
|
+
`);
|
|
179
|
+
</script>
|
|
180
|
+
|
|
181
|
+
<template>
|
|
182
|
+
<div class="demo-wrapper">
|
|
183
|
+
<lew-title>Form</lew-title>
|
|
184
|
+
<demo-box title="表单总览" :code="pre1">
|
|
185
|
+
<div class="form-box">
|
|
186
|
+
<lew-form-item direction="y" title="账号">
|
|
187
|
+
<LewInput
|
|
188
|
+
v-model="user.username"
|
|
189
|
+
v-tooltip="{
|
|
190
|
+
content: `输入账号`,
|
|
191
|
+
placement: `top`,
|
|
192
|
+
trigger: `focus`,
|
|
193
|
+
}"
|
|
194
|
+
/>
|
|
195
|
+
</lew-form-item>
|
|
196
|
+
<lew-form-item direction="y" title="密码">
|
|
197
|
+
<LewInput v-model="user.password" />
|
|
198
|
+
</lew-form-item>
|
|
199
|
+
<lew-form-item direction="y" title="简介">
|
|
200
|
+
<LewTextarea v-model="user.password" resize="none" />
|
|
201
|
+
</lew-form-item>
|
|
202
|
+
<lew-form-item direction="y" title="家地址">
|
|
203
|
+
<LewSelect v-model="user.home" :options="home_options" />
|
|
204
|
+
</lew-form-item>
|
|
205
|
+
<lew-form-item direction="y" title="性别">
|
|
206
|
+
<lew-radiobox-group
|
|
207
|
+
v-model="user.sex"
|
|
208
|
+
:options="sex_options"
|
|
209
|
+
/>
|
|
210
|
+
</lew-form-item>
|
|
211
|
+
<lew-form-item direction="y" title="爱好">
|
|
212
|
+
<lew-checkbox-group
|
|
213
|
+
v-model="user.hobby"
|
|
214
|
+
:options="hobby_options"
|
|
215
|
+
/>
|
|
216
|
+
</lew-form-item>
|
|
217
|
+
<lew-form-item direction="y" title="订阅">
|
|
218
|
+
<LewSwitch v-model="user.dark" />
|
|
219
|
+
</lew-form-item>
|
|
220
|
+
<lew-form-item direction="y" title="爱好">
|
|
221
|
+
<lew-tabs v-model="user.pay" :options="pay_options" />
|
|
222
|
+
</lew-form-item>
|
|
223
|
+
</div>
|
|
224
|
+
</demo-box>
|
|
225
|
+
</div>
|
|
226
|
+
</template>
|
|
227
|
+
<style scoped lang="scss">
|
|
228
|
+
.form-box {
|
|
229
|
+
width: 500px;
|
|
230
|
+
margin: 50px auto;
|
|
231
|
+
}
|
|
232
|
+
</style>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import DemoBox from '../../../components/demo/DemoBox.vue';
|
|
3
|
+
import { ref } from 'vue';
|
|
4
|
+
import { LewTitle, LewInput, LewFormItem } from '../../../components';
|
|
5
|
+
|
|
6
|
+
let pre1 = ref(`<template>
|
|
7
|
+
<div style="width: 300px">
|
|
8
|
+
<lew-form-item title="账号">
|
|
9
|
+
<LewInput />
|
|
10
|
+
</lew-form-item>
|
|
11
|
+
<lew-form-item title="密码">
|
|
12
|
+
<LewInput />
|
|
13
|
+
</lew-form-item>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
`);
|
|
17
|
+
let pre2 = ref(`<template>
|
|
18
|
+
<div style="width: 300px">
|
|
19
|
+
<lew-form-item title="账号" direction="y">
|
|
20
|
+
<LewInput />
|
|
21
|
+
</lew-form-item>
|
|
22
|
+
<lew-form-item title="密码" direction="y">
|
|
23
|
+
<LewInput />
|
|
24
|
+
</lew-form-item>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
`);
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<div class="demo-wrapper">
|
|
32
|
+
<lew-title>Input</lew-title>
|
|
33
|
+
|
|
34
|
+
<demo-box title="x 布局" :code="pre1">
|
|
35
|
+
<div style="width: 300px">
|
|
36
|
+
<lew-form-item title="账号">
|
|
37
|
+
<LewInput />
|
|
38
|
+
</lew-form-item>
|
|
39
|
+
<lew-form-item title="密码">
|
|
40
|
+
<LewInput />
|
|
41
|
+
</lew-form-item>
|
|
42
|
+
</div>
|
|
43
|
+
</demo-box>
|
|
44
|
+
<demo-box title="x 布局" :code="pre2">
|
|
45
|
+
<div style="width: 300px">
|
|
46
|
+
<lew-form-item title="账号" direction="y">
|
|
47
|
+
<LewInput />
|
|
48
|
+
</lew-form-item>
|
|
49
|
+
<lew-form-item title="密码" direction="y">
|
|
50
|
+
<LewInput />
|
|
51
|
+
</lew-form-item>
|
|
52
|
+
</div>
|
|
53
|
+
</demo-box>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { LewTitle, LewBadge } from '../../../components';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<div class="demo-wrapper">
|
|
7
|
+
<lew-title>Tag</lew-title>
|
|
8
|
+
<div>
|
|
9
|
+
<LewBadge type="primary">Github</LewBadge>
|
|
10
|
+
<LewBadge type="primary">Vue</LewBadge>
|
|
11
|
+
<LewBadge type="primary">Golang</LewBadge>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<style lang="scss" scoped>
|
|
17
|
+
.main {
|
|
18
|
+
width: 100%;
|
|
19
|
+
margin: 0 auto;
|
|
20
|
+
|
|
21
|
+
> div {
|
|
22
|
+
margin: 30px 0;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
</style>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import DemoBox from '../../../components/demo/DemoBox.vue';
|
|
3
|
+
import { ref } from 'vue';
|
|
4
|
+
import { LewTitle, LewRadioboxGroup } from '../../../components/index';
|
|
5
|
+
let value = ref();
|
|
6
|
+
|
|
7
|
+
let options = ref([
|
|
8
|
+
{ name: '宋朝', id: 1 },
|
|
9
|
+
{ name: '唐朝', id: 2 },
|
|
10
|
+
{ name: '明朝', id: 3 },
|
|
11
|
+
{ name: '清朝', id: 4 },
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
let pre1 = ref(`<script setup lang="ts">
|
|
15
|
+
import { ref } from 'vue';
|
|
16
|
+
import { LewRadioboxGroup } from '../../../components';
|
|
17
|
+
let value = ref();
|
|
18
|
+
|
|
19
|
+
let options = ref([
|
|
20
|
+
{ name: '宋朝', id: 1 },
|
|
21
|
+
{ name: '唐朝', id: 2 },
|
|
22
|
+
{ name: '明朝', id: 3 },
|
|
23
|
+
{ name: '清朝', id: 4 },
|
|
24
|
+
]);
|
|
25
|
+
<\/script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<lew-radiobox-group
|
|
29
|
+
v-model="value"
|
|
30
|
+
direction="x"
|
|
31
|
+
:options="options"
|
|
32
|
+
></lew-radiobox-group>
|
|
33
|
+
</template>
|
|
34
|
+
`);
|
|
35
|
+
let pre2 = ref(`<script setup lang="ts">
|
|
36
|
+
import { ref } from 'vue';
|
|
37
|
+
import { LewRadioboxGroup } from '../../../components';
|
|
38
|
+
let value = ref();
|
|
39
|
+
|
|
40
|
+
let options = ref([
|
|
41
|
+
{ name: '宋朝', id: 1 },
|
|
42
|
+
{ name: '唐朝', id: 2 },
|
|
43
|
+
{ name: '明朝', id: 3 },
|
|
44
|
+
{ name: '清朝', id: 4 },
|
|
45
|
+
]);
|
|
46
|
+
<\/script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<lew-radiobox-group
|
|
50
|
+
v-model="value"
|
|
51
|
+
direction="y"
|
|
52
|
+
:options="options"
|
|
53
|
+
></lew-radiobox-group>
|
|
54
|
+
</template>
|
|
55
|
+
`);
|
|
56
|
+
let pre3 = ref(`<script setup lang="ts">
|
|
57
|
+
import { ref } from 'vue';
|
|
58
|
+
import { LewRadioboxGroup } from '../../../components';
|
|
59
|
+
let value = ref();
|
|
60
|
+
|
|
61
|
+
let options = ref([
|
|
62
|
+
{ name: '宋朝', id: 1 },
|
|
63
|
+
{ name: '唐朝', id: 2 },
|
|
64
|
+
{ name: '明朝', id: 3 },
|
|
65
|
+
{ name: '清朝', id: 4 },
|
|
66
|
+
]);
|
|
67
|
+
<\/script>
|
|
68
|
+
|
|
69
|
+
<template>
|
|
70
|
+
<lew-radiobox-group
|
|
71
|
+
v-model="value"
|
|
72
|
+
block
|
|
73
|
+
:options="options"
|
|
74
|
+
></lew-radiobox-group>
|
|
75
|
+
</template>
|
|
76
|
+
`);
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<template>
|
|
80
|
+
<div class="demo-wrapper">
|
|
81
|
+
<lew-title>Radio</lew-title>
|
|
82
|
+
<demo-box title="x 布局" :code="pre1">
|
|
83
|
+
<lew-radiobox-group
|
|
84
|
+
v-model="value"
|
|
85
|
+
direction="x"
|
|
86
|
+
:options="options"
|
|
87
|
+
></lew-radiobox-group>
|
|
88
|
+
</demo-box>
|
|
89
|
+
<demo-box title="y 布局" :code="pre2">
|
|
90
|
+
<lew-radiobox-group
|
|
91
|
+
v-model="value"
|
|
92
|
+
direction="y"
|
|
93
|
+
:options="options"
|
|
94
|
+
></lew-radiobox-group>
|
|
95
|
+
</demo-box>
|
|
96
|
+
<demo-box title="块" :code="pre3">
|
|
97
|
+
<lew-radiobox-group
|
|
98
|
+
v-model="value"
|
|
99
|
+
block
|
|
100
|
+
:options="options"
|
|
101
|
+
></lew-radiobox-group>
|
|
102
|
+
</demo-box>
|
|
103
|
+
</div>
|
|
104
|
+
</template>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue';
|
|
3
|
+
import DemoBox from '../../../components/demo/DemoBox.vue';
|
|
4
|
+
import { LewTitle, LewFormItem, LewSelect } from '../../../components';
|
|
5
|
+
|
|
6
|
+
let value = ref('');
|
|
7
|
+
|
|
8
|
+
let options = ref([
|
|
9
|
+
{
|
|
10
|
+
label: '广东',
|
|
11
|
+
value: '1',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
label: '深圳',
|
|
15
|
+
value: '2',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: '杭州',
|
|
19
|
+
value: '3',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: '上海',
|
|
23
|
+
value: '4',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: '北京',
|
|
27
|
+
value: '5',
|
|
28
|
+
},
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
let pre1 = ref(`<script setup lang="ts">
|
|
32
|
+
import { ref } from 'vue';
|
|
33
|
+
import { LewFormItem, LewSelect } from '../../../components';
|
|
34
|
+
|
|
35
|
+
let value = ref('');
|
|
36
|
+
|
|
37
|
+
let options = ref([
|
|
38
|
+
{
|
|
39
|
+
label: '广东',
|
|
40
|
+
value: '1',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: '深圳',
|
|
44
|
+
value: '2',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: '杭州',
|
|
48
|
+
value: '3',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: '上海',
|
|
52
|
+
value: '4',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: '北京',
|
|
56
|
+
value: '5',
|
|
57
|
+
},
|
|
58
|
+
]);
|
|
59
|
+
<\/script>
|
|
60
|
+
|
|
61
|
+
<template>
|
|
62
|
+
<lew-form-item direction="y" title="选择城市">
|
|
63
|
+
<div style="width: 350px">
|
|
64
|
+
<LewSelect v-model="value" :options="options"></LewSelect></div
|
|
65
|
+
></lew-form-item>
|
|
66
|
+
</template>
|
|
67
|
+
`);
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<template>
|
|
71
|
+
<div class="demo-wrapper">
|
|
72
|
+
<lew-title>Select</lew-title>
|
|
73
|
+
<demo-box title="选择器" :code="pre1">
|
|
74
|
+
<lew-form-item direction="y" title="选择城市">
|
|
75
|
+
<div style="width: 350px">
|
|
76
|
+
<LewSelect
|
|
77
|
+
v-model="value"
|
|
78
|
+
:options="options"
|
|
79
|
+
></LewSelect></div
|
|
80
|
+
></lew-form-item>
|
|
81
|
+
</demo-box>
|
|
82
|
+
</div>
|
|
83
|
+
</template>
|