@vtj/materials 0.8.146 → 0.8.148
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/dist/assets/antdv/index.umd.js +2 -2
- package/dist/assets/charts/index.umd.js +2 -2
- package/dist/assets/element/index.umd.js +2 -2
- package/dist/assets/ui/index.umd.js +2 -2
- package/dist/assets/vant/index.umd.js +31 -0
- package/dist/deps/@vtj/charts/index.umd.js +2 -2
- package/dist/deps/@vtj/icons/index.umd.js +2 -2
- package/dist/deps/@vtj/ui/index.umd.js +9 -9
- package/dist/deps/@vtj/utils/index.umd.js +4 -4
- package/dist/deps/ant-design-vue/antd.min.js +1 -1
- package/dist/deps/vant/index.css +1 -0
- package/dist/deps/vant/vant.min.js +6 -0
- package/dist/deps/vue/vue.global.js +62 -23
- package/dist/deps/vue/vue.global.prod.js +3 -3
- package/package.json +8 -7
- package/src/vant/action-bar.ts +199 -0
- package/src/vant/action-sheet.ts +149 -0
- package/src/vant/address-edit.ts +156 -0
- package/src/vant/address-list.ts +104 -0
- package/src/vant/area.ts +120 -0
- package/src/vant/back-top.ts +57 -0
- package/src/vant/badge.ts +74 -0
- package/src/vant/barrage.ts +65 -0
- package/src/vant/button.ts +132 -0
- package/src/vant/calendar.ts +268 -0
- package/src/vant/card.ts +97 -0
- package/src/vant/cascader.ts +91 -0
- package/src/vant/cell.ts +180 -0
- package/src/vant/checkbox.ts +156 -0
- package/src/vant/circle.ts +94 -0
- package/src/vant/collapse.ts +157 -0
- package/src/vant/contact-card.ts +44 -0
- package/src/vant/contact-edit.ts +69 -0
- package/src/vant/contact-list.ts +59 -0
- package/src/vant/count-down.ts +44 -0
- package/src/vant/coupon-list.ts +219 -0
- package/src/vant/datePicker.ts +119 -0
- package/src/vant/dialog.ts +187 -0
- package/src/vant/divider.ts +42 -0
- package/src/vant/dropdown-menu.ts +162 -0
- package/src/vant/empty.ts +36 -0
- package/src/vant/field.ts +282 -0
- package/src/vant/floating-bubble.ts +59 -0
- package/src/vant/floating-panel.ts +86 -0
- package/src/vant/form.ts +140 -0
- package/src/vant/grid.ts +160 -0
- package/src/vant/highlight.ts +70 -0
- package/src/vant/icon.ts +65 -0
- package/src/vant/image-preview.ts +166 -0
- package/src/vant/image.ts +120 -0
- package/src/vant/index-bar.ts +85 -0
- package/src/vant/index.ts +221 -0
- package/src/vant/layout.ts +98 -0
- package/src/vant/lazyload.ts +12 -0
- package/src/vant/list.ts +126 -0
- package/src/vant/loading.ts +51 -0
- package/src/vant/nav-bar.ts +95 -0
- package/src/vant/notice-bar.ts +78 -0
- package/src/vant/notify.ts +96 -0
- package/src/vant/number-keyboard.ts +122 -0
- package/src/vant/overlay.ts +60 -0
- package/src/vant/pagination.ts +87 -0
- package/src/vant/password-input.ts +58 -0
- package/src/vant/picker-group.ts +63 -0
- package/src/vant/picker.ts +139 -0
- package/src/vant/popover.ts +165 -0
- package/src/vant/popup.ts +164 -0
- package/src/vant/progress.ts +71 -0
- package/src/vant/pull-refresh.ts +83 -0
- package/src/vant/radio.ts +126 -0
- package/src/vant/rate.ts +108 -0
- package/src/vant/rolling-text.ts +68 -0
- package/src/vant/search.ts +170 -0
- package/src/vant/share-sheet.ts +146 -0
- package/src/vant/sidebar.ts +92 -0
- package/src/vant/signature.ts +60 -0
- package/src/vant/skeleton.ts +170 -0
- package/src/vant/slider.ts +103 -0
- package/src/vant/space.ts +63 -0
- package/src/vant/stepper.ts +162 -0
- package/src/vant/steps.ts +85 -0
- package/src/vant/sticky.ts +52 -0
- package/src/vant/submit-bar.ts +101 -0
- package/src/vant/swipe-cell.ts +85 -0
- package/src/vant/swipe.ts +128 -0
- package/src/vant/switch.ts +68 -0
- package/src/vant/tab.ts +236 -0
- package/src/vant/tabbar.ts +174 -0
- package/src/vant/tag.ts +78 -0
- package/src/vant/text-ellipsis.ts +54 -0
- package/src/vant/time-picker.ts +158 -0
- package/src/vant/toast.ts +155 -0
- package/src/vant/tree-select.ts +80 -0
- package/src/vant/uploader.ts +164 -0
- package/src/vant/watermark.ts +82 -0
- package/src/version.ts +2 -2
@@ -0,0 +1,120 @@
|
|
1
|
+
import type { MaterialDescription } from '@vtj/core';
|
2
|
+
|
3
|
+
const Image: MaterialDescription = {
|
4
|
+
name: 'VantImage',
|
5
|
+
alias: 'Image',
|
6
|
+
label: '图片',
|
7
|
+
categoryId: 'base',
|
8
|
+
doc: 'https://vant-ui.github.io/vant/#/zh-CN/image',
|
9
|
+
props: [
|
10
|
+
{
|
11
|
+
name: 'src',
|
12
|
+
title: '图片链接',
|
13
|
+
setters: 'StringSetter'
|
14
|
+
},
|
15
|
+
{
|
16
|
+
name: 'fit',
|
17
|
+
title: '图片填充模式,等同于原生的 object-fit 属性',
|
18
|
+
defaultValue: 'fill',
|
19
|
+
setters: 'StringSetter'
|
20
|
+
},
|
21
|
+
{
|
22
|
+
name: 'position',
|
23
|
+
title: '图片位置,等同于原生的 object-position 属性',
|
24
|
+
defaultValue: 'center',
|
25
|
+
setters: ['SelectSetter', 'StringSetter'],
|
26
|
+
options: ['top', 'right', 'bottom', 'left', 'center']
|
27
|
+
},
|
28
|
+
{
|
29
|
+
name: 'alt',
|
30
|
+
title: '替代文本',
|
31
|
+
setters: 'StringSetter'
|
32
|
+
},
|
33
|
+
{
|
34
|
+
name: 'width',
|
35
|
+
title: '宽度,默认单位为 px',
|
36
|
+
setters: ['NumberSetter', 'StringSetter']
|
37
|
+
},
|
38
|
+
{
|
39
|
+
name: 'height',
|
40
|
+
title: '高度,默认单位为 px',
|
41
|
+
setters: ['NumberSetter', 'StringSetter']
|
42
|
+
},
|
43
|
+
{
|
44
|
+
name: 'radius',
|
45
|
+
title: '圆角大小,默认单位为 px',
|
46
|
+
defaultValue: 0,
|
47
|
+
setters: ['NumberSetter', 'StringSetter']
|
48
|
+
},
|
49
|
+
{
|
50
|
+
name: 'round',
|
51
|
+
title: '是否显示为圆形',
|
52
|
+
defaultValue: false,
|
53
|
+
setters: 'BooleanSetter'
|
54
|
+
},
|
55
|
+
{
|
56
|
+
name: 'block',
|
57
|
+
title: '是否将根节点设置为块级元素,默认情况下为 inline-block 元素',
|
58
|
+
defaultValue: false,
|
59
|
+
setters: 'BooleanSetter'
|
60
|
+
},
|
61
|
+
{
|
62
|
+
name: 'show-error',
|
63
|
+
title: '是否展示图片加载失败提示',
|
64
|
+
defaultValue: true,
|
65
|
+
setters: 'BooleanSetter'
|
66
|
+
},
|
67
|
+
{
|
68
|
+
name: 'show-loading',
|
69
|
+
title: '是否展示图片加载中提示',
|
70
|
+
defaultValue: true,
|
71
|
+
setters: 'BooleanSetter'
|
72
|
+
},
|
73
|
+
{
|
74
|
+
name: 'error-icon',
|
75
|
+
title: '失败时提示的图标名称或图片链接,等同于 Icon 组件的 name 属性',
|
76
|
+
defaultValue: 'photo-fail',
|
77
|
+
setters: 'StringSetter'
|
78
|
+
},
|
79
|
+
{
|
80
|
+
name: 'loading-icon',
|
81
|
+
title: '加载时提示的图标名称或图片链接,等同于 Icon 组件的 name 属性',
|
82
|
+
defaultValue: 'photo',
|
83
|
+
setters: 'StringSetter'
|
84
|
+
},
|
85
|
+
{
|
86
|
+
name: 'icon-size',
|
87
|
+
title: '加载图标和失败图标的大小',
|
88
|
+
defaultValue: 32,
|
89
|
+
setters: ['NumberSetter', 'StringSetter']
|
90
|
+
},
|
91
|
+
{
|
92
|
+
name: 'icon-prefix',
|
93
|
+
title: '图标类名前缀,等同于 Icon 组件的 class-prefix 属性',
|
94
|
+
defaultValue: 'van-icon',
|
95
|
+
setters: 'StringSetter'
|
96
|
+
},
|
97
|
+
{
|
98
|
+
name: 'crossorigin',
|
99
|
+
title: '等同于原生的 crossorigin 属性',
|
100
|
+
setters: 'StringSetter'
|
101
|
+
},
|
102
|
+
{
|
103
|
+
name: 'referrerpolicy',
|
104
|
+
title: '等同于原生的 referrerpolicy 属性',
|
105
|
+
setters: 'StringSetter'
|
106
|
+
}
|
107
|
+
],
|
108
|
+
events: ['click', 'load', 'error'],
|
109
|
+
slots: ['default', 'loading', 'error'],
|
110
|
+
snippet: {
|
111
|
+
props: {
|
112
|
+
width: '10rem',
|
113
|
+
height: '10rem',
|
114
|
+
fit: 'contain',
|
115
|
+
src: 'https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg'
|
116
|
+
}
|
117
|
+
}
|
118
|
+
};
|
119
|
+
|
120
|
+
export default Image;
|
@@ -0,0 +1,85 @@
|
|
1
|
+
import type { MaterialDescription } from '@vtj/core';
|
2
|
+
|
3
|
+
const IndexBar: MaterialDescription[] = [
|
4
|
+
{
|
5
|
+
name: 'VantIndexBar',
|
6
|
+
alias: 'IndexBar',
|
7
|
+
label: '索引栏',
|
8
|
+
categoryId: 'nav',
|
9
|
+
doc: 'https://vant-ui.github.io/vant/#/zh-CN/index-bar',
|
10
|
+
props: [
|
11
|
+
{
|
12
|
+
name: 'index-list',
|
13
|
+
title: '索引字符列表',
|
14
|
+
setters: 'ArraySetter'
|
15
|
+
},
|
16
|
+
{
|
17
|
+
name: 'z-index',
|
18
|
+
title: 'z-index 层级',
|
19
|
+
defaultValue: 1,
|
20
|
+
setters: ['NumberSetter', 'StringSetter']
|
21
|
+
},
|
22
|
+
{
|
23
|
+
name: 'sticky',
|
24
|
+
title: '是否开启锚点自动吸顶',
|
25
|
+
defaultValue: true,
|
26
|
+
setters: 'BooleanSetter'
|
27
|
+
},
|
28
|
+
{
|
29
|
+
name: 'sticky-offset-top',
|
30
|
+
title: '锚点自动吸顶时与顶部的距离',
|
31
|
+
defaultValue: 0,
|
32
|
+
setters: 'NumberSetter'
|
33
|
+
},
|
34
|
+
{
|
35
|
+
name: 'highlight-color',
|
36
|
+
title: '索引字符高亮颜色',
|
37
|
+
defaultValue: '#1989fa',
|
38
|
+
setters: 'StringSetter'
|
39
|
+
},
|
40
|
+
{
|
41
|
+
name: 'teleport',
|
42
|
+
title: '指定索引栏挂载的节点',
|
43
|
+
setters: ['StringSetter', 'ExpressionSetter']
|
44
|
+
}
|
45
|
+
],
|
46
|
+
events: [
|
47
|
+
{ name: 'select', params: ['index'] },
|
48
|
+
{ name: 'change', params: ['index'] }
|
49
|
+
],
|
50
|
+
snippet: {
|
51
|
+
children: [
|
52
|
+
{ name: 'VantIndexAnchor', props: { index: 'A' } },
|
53
|
+
{ name: 'VantCell', props: { title: '文本' } },
|
54
|
+
{ name: 'VantCell', props: { title: '文本' } },
|
55
|
+
{ name: 'VantCell', props: { title: '文本' } },
|
56
|
+
{ name: 'VantIndexAnchor', props: { index: 'B' } },
|
57
|
+
{ name: 'VantCell', props: { title: '文本' } },
|
58
|
+
{ name: 'VantCell', props: { title: '文本' } },
|
59
|
+
{ name: 'VantCell', props: { title: '文本' } }
|
60
|
+
]
|
61
|
+
}
|
62
|
+
},
|
63
|
+
{
|
64
|
+
name: 'VantIndexAnchor',
|
65
|
+
alias: 'IndexAnchor',
|
66
|
+
label: '索引栏锚点',
|
67
|
+
categoryId: 'nav',
|
68
|
+
doc: 'https://vant-ui.github.io/vant/#/zh-CN/index-bar',
|
69
|
+
props: [
|
70
|
+
{
|
71
|
+
name: 'index',
|
72
|
+
title: '索引字符',
|
73
|
+
setters: ['StringSetter', 'NumberSetter']
|
74
|
+
}
|
75
|
+
],
|
76
|
+
slots: ['default'],
|
77
|
+
snippet: {
|
78
|
+
props: {
|
79
|
+
index: 'C'
|
80
|
+
}
|
81
|
+
}
|
82
|
+
}
|
83
|
+
];
|
84
|
+
|
85
|
+
export default IndexBar;
|
@@ -0,0 +1,221 @@
|
|
1
|
+
import type {
|
2
|
+
Material,
|
3
|
+
MaterialCategory,
|
4
|
+
MaterialDescription
|
5
|
+
} from '@vtj/core';
|
6
|
+
import { setPackageName } from '../shared';
|
7
|
+
import { version } from '../version';
|
8
|
+
|
9
|
+
// base 基础组件
|
10
|
+
import Button from './button';
|
11
|
+
import Cell from './cell';
|
12
|
+
import Icon from './icon';
|
13
|
+
import Image from './image';
|
14
|
+
import Layout from './layout';
|
15
|
+
import Popup from './popup';
|
16
|
+
import Space from './space';
|
17
|
+
import Toast from './toast';
|
18
|
+
// form 表单组件
|
19
|
+
import Calendar from './calendar';
|
20
|
+
import Cascader from './cascader';
|
21
|
+
import Checkbox from './checkbox';
|
22
|
+
import DatePicker from './datePicker';
|
23
|
+
import Field from './field';
|
24
|
+
import Form from './form';
|
25
|
+
import NumberKeyboard from './number-keyboard';
|
26
|
+
import PasswordInput from './password-input';
|
27
|
+
import Picker from './picker';
|
28
|
+
import PickerGroup from './picker-group';
|
29
|
+
import Radio from './radio';
|
30
|
+
import Rate from './rate';
|
31
|
+
import Search from './search';
|
32
|
+
import Slider from './slider';
|
33
|
+
import Signature from './signature';
|
34
|
+
import Stepper from './stepper';
|
35
|
+
import Switch from './switch';
|
36
|
+
import TimePicker from './time-picker';
|
37
|
+
import Uploader from './uploader';
|
38
|
+
// feedback 反馈组件
|
39
|
+
import ActionSheet from './action-sheet';
|
40
|
+
import Barrage from './barrage';
|
41
|
+
import Dialog from './dialog';
|
42
|
+
import DropdownMenu from './dropdown-menu';
|
43
|
+
import FloatingPanel from './floating-panel';
|
44
|
+
import FloatingBubble from './floating-bubble';
|
45
|
+
import Loading from './loading';
|
46
|
+
import Notify from './notify';
|
47
|
+
import Overlay from './overlay';
|
48
|
+
import PullRefresh from './pull-refresh';
|
49
|
+
import ShareSheet from './share-sheet';
|
50
|
+
import SwipeCell from './swipe-cell';
|
51
|
+
// view 展示组件
|
52
|
+
import Badge from './badge';
|
53
|
+
import Circle from './circle';
|
54
|
+
import Collapse from './collapse';
|
55
|
+
import CountDown from './count-down';
|
56
|
+
import Divider from './divider';
|
57
|
+
import Empty from './empty';
|
58
|
+
import Highlight from './highlight';
|
59
|
+
import ImagePreview from './image-preview';
|
60
|
+
import Lazyload from './lazyload';
|
61
|
+
import List from './list';
|
62
|
+
import NoticeBar from './notice-bar';
|
63
|
+
import Popover from './popover';
|
64
|
+
import Progress from './progress';
|
65
|
+
import RollingText from './rolling-text';
|
66
|
+
import Skeleton from './skeleton';
|
67
|
+
import Steps from './steps';
|
68
|
+
import Sticky from './sticky';
|
69
|
+
import Swipe from './swipe';
|
70
|
+
import Tag from './tag';
|
71
|
+
import TextEllipsis from './text-ellipsis';
|
72
|
+
import Watermark from './watermark';
|
73
|
+
// nav 导航组件
|
74
|
+
import ActionBar from './action-bar';
|
75
|
+
import BackTop from './back-top';
|
76
|
+
import Grid from './grid';
|
77
|
+
import IndexBar from './index-bar';
|
78
|
+
import NavBar from './nav-bar';
|
79
|
+
import Pagination from './pagination';
|
80
|
+
import Sidebar from './sidebar';
|
81
|
+
import Tab from './tab';
|
82
|
+
import Tabbar from './tabbar';
|
83
|
+
import TreeSelect from './tree-select';
|
84
|
+
import AddressEdit from './address-edit';
|
85
|
+
import AddressList from './address-list';
|
86
|
+
import Area from './area';
|
87
|
+
import Card from './card';
|
88
|
+
import ContactCard from './contact-card';
|
89
|
+
import ContactEdit from './contact-edit';
|
90
|
+
import ContactList from './contact-list';
|
91
|
+
import Coupon from './coupon-list';
|
92
|
+
import SubmitBar from './submit-bar';
|
93
|
+
// business 业务组件
|
94
|
+
|
95
|
+
const name = 'vant';
|
96
|
+
const components: MaterialDescription[] = [
|
97
|
+
// base 基础组件
|
98
|
+
Button,
|
99
|
+
Cell,
|
100
|
+
Icon,
|
101
|
+
Image,
|
102
|
+
Layout,
|
103
|
+
Popup,
|
104
|
+
Space,
|
105
|
+
Toast,
|
106
|
+
// form 表单组件
|
107
|
+
Calendar,
|
108
|
+
Cascader,
|
109
|
+
Checkbox,
|
110
|
+
DatePicker,
|
111
|
+
Field,
|
112
|
+
Form,
|
113
|
+
NumberKeyboard,
|
114
|
+
PasswordInput,
|
115
|
+
Picker,
|
116
|
+
PickerGroup,
|
117
|
+
Radio,
|
118
|
+
Rate,
|
119
|
+
Search,
|
120
|
+
Slider,
|
121
|
+
Signature,
|
122
|
+
Stepper,
|
123
|
+
Switch,
|
124
|
+
TimePicker,
|
125
|
+
Uploader,
|
126
|
+
// feedback 反馈组件
|
127
|
+
ActionSheet,
|
128
|
+
Barrage,
|
129
|
+
Dialog,
|
130
|
+
DropdownMenu,
|
131
|
+
FloatingPanel,
|
132
|
+
FloatingBubble,
|
133
|
+
Loading,
|
134
|
+
Notify,
|
135
|
+
Overlay,
|
136
|
+
PullRefresh,
|
137
|
+
ShareSheet,
|
138
|
+
SwipeCell,
|
139
|
+
// view 展示组件
|
140
|
+
Badge,
|
141
|
+
Circle,
|
142
|
+
Collapse,
|
143
|
+
CountDown,
|
144
|
+
Divider,
|
145
|
+
Empty,
|
146
|
+
Highlight,
|
147
|
+
ImagePreview,
|
148
|
+
Lazyload,
|
149
|
+
List,
|
150
|
+
NoticeBar,
|
151
|
+
Popover,
|
152
|
+
Progress,
|
153
|
+
RollingText,
|
154
|
+
Skeleton,
|
155
|
+
Steps,
|
156
|
+
Sticky,
|
157
|
+
Swipe,
|
158
|
+
Tag,
|
159
|
+
TextEllipsis,
|
160
|
+
Watermark,
|
161
|
+
// nav 导航组件
|
162
|
+
ActionBar,
|
163
|
+
BackTop,
|
164
|
+
Grid,
|
165
|
+
IndexBar,
|
166
|
+
NavBar,
|
167
|
+
Pagination,
|
168
|
+
Sidebar,
|
169
|
+
Tab,
|
170
|
+
Tabbar,
|
171
|
+
TreeSelect,
|
172
|
+
// business 业务组件
|
173
|
+
AddressEdit,
|
174
|
+
AddressList,
|
175
|
+
Area,
|
176
|
+
Card,
|
177
|
+
ContactCard,
|
178
|
+
ContactEdit,
|
179
|
+
ContactList,
|
180
|
+
Coupon,
|
181
|
+
SubmitBar
|
182
|
+
].flat();
|
183
|
+
|
184
|
+
const categories: MaterialCategory[] = [
|
185
|
+
{
|
186
|
+
id: 'base',
|
187
|
+
category: '基础组件'
|
188
|
+
},
|
189
|
+
{
|
190
|
+
id: 'form',
|
191
|
+
category: '表单组件'
|
192
|
+
},
|
193
|
+
{
|
194
|
+
id: 'feedback',
|
195
|
+
category: '反馈组件'
|
196
|
+
},
|
197
|
+
{
|
198
|
+
id: 'view',
|
199
|
+
category: '展示组件'
|
200
|
+
},
|
201
|
+
{
|
202
|
+
id: 'nav',
|
203
|
+
category: '导航组件'
|
204
|
+
},
|
205
|
+
{
|
206
|
+
id: 'business',
|
207
|
+
category: '业务组件'
|
208
|
+
}
|
209
|
+
];
|
210
|
+
|
211
|
+
const material: Material = {
|
212
|
+
name: 'vant',
|
213
|
+
version,
|
214
|
+
label: 'Vant',
|
215
|
+
library: 'VantMaterial',
|
216
|
+
order: 5,
|
217
|
+
categories,
|
218
|
+
components: setPackageName(components, name)
|
219
|
+
};
|
220
|
+
|
221
|
+
export default material;
|
@@ -0,0 +1,98 @@
|
|
1
|
+
import type { MaterialDescription } from '@vtj/core';
|
2
|
+
|
3
|
+
const Layout: MaterialDescription[] = [
|
4
|
+
{
|
5
|
+
name: 'VantRow',
|
6
|
+
alias: 'Row',
|
7
|
+
label: '布局行',
|
8
|
+
categoryId: 'base',
|
9
|
+
doc: 'https://vant-ui.github.io/vant/#/zh-CN/col',
|
10
|
+
props: [
|
11
|
+
{
|
12
|
+
name: 'gutter',
|
13
|
+
title: '列元素之间的间距(单位为 px)',
|
14
|
+
setters: ['NumberSetter', 'StringSetter', 'ArraySetter']
|
15
|
+
},
|
16
|
+
{
|
17
|
+
name: 'tag',
|
18
|
+
title: '自定义元素标签',
|
19
|
+
defaultValue: 'div',
|
20
|
+
setters: 'StringSetter'
|
21
|
+
},
|
22
|
+
{
|
23
|
+
name: 'justify',
|
24
|
+
title: '主轴对齐方式',
|
25
|
+
defaultValue: 'start',
|
26
|
+
setters: 'SelectSetter',
|
27
|
+
options: ['start', 'end', 'center', 'space-around', 'space-between']
|
28
|
+
},
|
29
|
+
{
|
30
|
+
name: 'align',
|
31
|
+
title: '交叉轴对齐方式',
|
32
|
+
defaultValue: 'top',
|
33
|
+
setters: 'SelectSetter',
|
34
|
+
options: ['top', 'center', 'bottom']
|
35
|
+
},
|
36
|
+
{
|
37
|
+
name: 'wrap',
|
38
|
+
title: '是否自动换行',
|
39
|
+
defaultValue: true,
|
40
|
+
setters: 'BooleanSetter'
|
41
|
+
}
|
42
|
+
],
|
43
|
+
events: ['click'],
|
44
|
+
snippet: {
|
45
|
+
children: [
|
46
|
+
{
|
47
|
+
name: 'VantCol',
|
48
|
+
children: 'span:8',
|
49
|
+
props: {
|
50
|
+
span: '8'
|
51
|
+
}
|
52
|
+
},
|
53
|
+
{
|
54
|
+
name: 'VantCol',
|
55
|
+
children: 'span:8',
|
56
|
+
props: {
|
57
|
+
span: '8'
|
58
|
+
}
|
59
|
+
}
|
60
|
+
]
|
61
|
+
}
|
62
|
+
},
|
63
|
+
{
|
64
|
+
name: 'VantCol',
|
65
|
+
alias: 'Col',
|
66
|
+
label: '布局列',
|
67
|
+
categoryId: 'base',
|
68
|
+
doc: 'https://vant-ui.github.io/vant/#/zh-CN/col',
|
69
|
+
props: [
|
70
|
+
{
|
71
|
+
name: 'span',
|
72
|
+
title: '列元素宽度',
|
73
|
+
setters: ['NumberSetter', 'StringSetter']
|
74
|
+
},
|
75
|
+
{
|
76
|
+
name: 'offset',
|
77
|
+
title: '列元素偏移距离',
|
78
|
+
setters: ['NumberSetter', 'StringSetter']
|
79
|
+
},
|
80
|
+
{
|
81
|
+
name: 'tag',
|
82
|
+
title: '自定义元素标签',
|
83
|
+
defaultValue: 'div',
|
84
|
+
setters: 'StringSetter'
|
85
|
+
}
|
86
|
+
],
|
87
|
+
events: ['click'],
|
88
|
+
snippet: {
|
89
|
+
name: 'VantCol',
|
90
|
+
children: 'span:8',
|
91
|
+
props: {
|
92
|
+
span: '8'
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
];
|
97
|
+
|
98
|
+
export default Layout;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import type { MaterialDescription } from '@vtj/core';
|
2
|
+
|
3
|
+
const Lazyload: MaterialDescription = {
|
4
|
+
name: 'VantImageLazyload',
|
5
|
+
alias: 'Lazyload',
|
6
|
+
label: '懒加载',
|
7
|
+
categoryId: 'view',
|
8
|
+
doc: 'https://vant-ui.github.io/vant/#/zh-CN/lazyload',
|
9
|
+
snippet: {}
|
10
|
+
};
|
11
|
+
|
12
|
+
export default Lazyload;
|
package/src/vant/list.ts
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
import type { MaterialDescription } from '@vtj/core';
|
2
|
+
|
3
|
+
const List: MaterialDescription = {
|
4
|
+
name: 'VantList',
|
5
|
+
alias: 'List',
|
6
|
+
label: '列表',
|
7
|
+
categoryId: 'view',
|
8
|
+
doc: 'https://vant-ui.github.io/vant/#/zh-CN/list',
|
9
|
+
props: [
|
10
|
+
{
|
11
|
+
name: 'loading',
|
12
|
+
title: '是否处于加载状态,加载过程中不触发 load 事件',
|
13
|
+
defaultValue: false,
|
14
|
+
setters: 'BooleanSetter'
|
15
|
+
},
|
16
|
+
{
|
17
|
+
name: 'error',
|
18
|
+
title: '是否加载失败,加载失败后点击错误提示可以重新触发 load 事件',
|
19
|
+
defaultValue: false,
|
20
|
+
setters: 'BooleanSetter'
|
21
|
+
},
|
22
|
+
{
|
23
|
+
name: 'finished',
|
24
|
+
title: '是否已加载完成,加载完成后不再触发 load 事件',
|
25
|
+
defaultValue: false,
|
26
|
+
setters: 'BooleanSetter'
|
27
|
+
},
|
28
|
+
{
|
29
|
+
name: 'offset',
|
30
|
+
title: '滚动条与底部距离小于 offset 时触发 load 事件',
|
31
|
+
defaultValue: 300,
|
32
|
+
setters: ['NumberSetter', 'StringSetter']
|
33
|
+
},
|
34
|
+
{
|
35
|
+
name: 'loading-text',
|
36
|
+
title: '加载过程中的提示文案',
|
37
|
+
defaultValue: '加载中...',
|
38
|
+
setters: 'StringSetter'
|
39
|
+
},
|
40
|
+
{
|
41
|
+
name: 'finished-text',
|
42
|
+
title: '加载完成后的提示文案',
|
43
|
+
setters: 'StringSetter'
|
44
|
+
},
|
45
|
+
{
|
46
|
+
name: 'error-text',
|
47
|
+
title: '加载失败后的提示文案',
|
48
|
+
setters: 'StringSetter'
|
49
|
+
},
|
50
|
+
{
|
51
|
+
name: 'immediate-check',
|
52
|
+
title: '是否在初始化时立即执行滚动位置检查',
|
53
|
+
defaultValue: true,
|
54
|
+
setters: 'BooleanSetter'
|
55
|
+
},
|
56
|
+
{
|
57
|
+
name: 'disabled',
|
58
|
+
title: '是否禁用滚动加载',
|
59
|
+
defaultValue: false,
|
60
|
+
setters: 'BooleanSetter'
|
61
|
+
},
|
62
|
+
{
|
63
|
+
name: 'direction',
|
64
|
+
title: '滚动触发加载的方向,可选值为 up',
|
65
|
+
defaultValue: 'down',
|
66
|
+
setters: 'SelectSetter',
|
67
|
+
options: ['up', 'down']
|
68
|
+
},
|
69
|
+
{
|
70
|
+
name: 'scroller',
|
71
|
+
title: '指定需要监听滚动事件的节点,默认为最近的父级滚动节点',
|
72
|
+
setters: 'ExpressionSetter'
|
73
|
+
}
|
74
|
+
],
|
75
|
+
events: ['update:loading', 'update:error', 'load'],
|
76
|
+
snippet: {
|
77
|
+
props: {
|
78
|
+
loading: {
|
79
|
+
type: 'JSExpression',
|
80
|
+
value: 'this.state.loading'
|
81
|
+
},
|
82
|
+
finished: {
|
83
|
+
type: 'JSExpression',
|
84
|
+
value: 'this.state.finished'
|
85
|
+
},
|
86
|
+
'finished-text': '没有更多了'
|
87
|
+
},
|
88
|
+
children: [
|
89
|
+
{
|
90
|
+
name: 'VantCell',
|
91
|
+
props: {
|
92
|
+
key: {
|
93
|
+
type: 'JSExpression',
|
94
|
+
value: 'this.context.item'
|
95
|
+
},
|
96
|
+
title: {
|
97
|
+
type: 'JSExpression',
|
98
|
+
value: 'this.context.item'
|
99
|
+
}
|
100
|
+
},
|
101
|
+
directives: [
|
102
|
+
{
|
103
|
+
name: 'vFor',
|
104
|
+
value: {
|
105
|
+
type: 'JSExpression',
|
106
|
+
value: '20'
|
107
|
+
}
|
108
|
+
}
|
109
|
+
]
|
110
|
+
}
|
111
|
+
],
|
112
|
+
events: {
|
113
|
+
load: {
|
114
|
+
name: 'load',
|
115
|
+
handler: {
|
116
|
+
type: 'JSFunction',
|
117
|
+
value:
|
118
|
+
'() => {\r\n setTimeout(() => {\r\n if (this.state.refreshing) {\r\n this.state.list = [];\r\n this.state.refreshing = false;\r\n }\r\n\r\n for (let i = 0; i < 10; i++) {\r\n this.state.list.push(this.state.list.length + 1);\r\n }\r\n this.loading = false;\r\n\r\n if (this.state.list.length >= 40) {\r\n this.finished = true;\r\n }\r\n }, 1000);\r\n};'
|
119
|
+
},
|
120
|
+
modifiers: {}
|
121
|
+
}
|
122
|
+
}
|
123
|
+
}
|
124
|
+
};
|
125
|
+
|
126
|
+
export default List;
|