Compare commits

...

7 Commits

Author SHA1 Message Date
neverland
3214b1dd80
chore: remove isNaN util, re-organize validate utils (#8473) 2021-04-08 10:08:03 +08:00
neverland
9f93dd9d61
chore: remove dead code (#8472) 2021-04-08 10:00:52 +08:00
dengrongyao
56429ad4e1 docs: 调整组件介绍文档 2021-04-08 09:57:55 +08:00
dengrongyao
0c6f7c63a7 docs: Adjust meaning 2021-04-08 09:57:55 +08:00
dengrongyao
55afff0e9c docs: Adjust punctuation 2021-04-08 09:57:55 +08:00
dengrongyao
2210f8240d docs: Supplement English intro 2021-04-08 09:57:55 +08:00
dengrongyao
cf7eadc6b2 docs: Supplement Chinese intro 2021-04-08 09:57:55 +08:00
102 changed files with 426 additions and 175 deletions

View File

@ -1,8 +1,12 @@
# ActionBar
### Intro
Used to provide convenient interaction for page-related operations.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,5 +1,9 @@
# ActionBar 动作栏
### 介绍
用于为页面相关操作提供便捷交互。
### 引入
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。

View File

@ -1,8 +1,12 @@
# ActionSheet
### Intro
The pop-up modal panel at the bottom contains multiple options related to the current situation.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -9,8 +9,12 @@ import {
} from 'vue';
// Utils
import { ComponentInstance, createNamespace, isObject } from '../utils';
import { isMobile } from '../utils/validate/mobile';
import {
isObject,
isMobile,
createNamespace,
ComponentInstance,
} from '../utils';
// Composables
import { useExpose } from '../composables/use-expose';

View File

@ -1,8 +1,7 @@
import { PropType, ref, defineComponent } from 'vue';
// Utils
import { ComponentInstance, createNamespace } from '../utils';
import { isAndroid } from '../utils/validate/system';
import { isAndroid, ComponentInstance, createNamespace } from '../utils';
// Components
import { Cell } from '../cell';

View File

@ -1,8 +1,12 @@
# AddressEdit
### Intro
Used to create, update, and delete receiving addresses.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';
@ -145,7 +149,7 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get Addres
### Area Data Structure
Please refer to [Area](#/en-US/area) component
Please refer to [Area](#/en-US/area) component.
### Less Variables

View File

@ -1,8 +1,12 @@
# AddressList
### Intro
Display a list of receiving addresses.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -2,11 +2,11 @@
### Intro
The Picker component is usually used with [Popup](#/en-US/popup) Component.
A three-level linkage selection of provinces and cities, usually used in conjunction with [Popup](#/en-US/popup) component.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,6 +1,5 @@
import { PropType, CSSProperties, defineComponent } from 'vue';
import { isDef, createNamespace } from '../utils';
import { isNumeric } from '../utils/validate/number';
import { isDef, isNumeric, createNamespace } from '../utils';
const [name, bem] = createNamespace('badge');

View File

@ -1,8 +1,12 @@
# Badge
### Intro
Display a small badge or a red dot to the top-right of its child.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Button
### Intro
Buttons are used to trigger an action, such as submitting a form.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -9,8 +9,7 @@ import {
} from 'vue';
// Utils
import { pick, getScrollTop, ComponentInstance } from '../utils';
import { isDate } from '../utils/validate/date';
import { pick, isDate, getScrollTop, ComponentInstance } from '../utils';
import {
t,
bem,

View File

@ -6,7 +6,7 @@ Calendar component for selecting dates or date ranges.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Card
### Intro
Used to display product pictures, prices and other information.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Cascader
### Intro
The cascader component is used for the selection of multi-level data. The typical scene is the selection of provinces and cities.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Cell
### Intro
The cell is a single display item in the list.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Checkbox
### Intro
A group of options for multiple choices.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -2,7 +2,7 @@
### 介绍
用于在选中和非选中状态之间进行切换
在一组备选项中进行多选
### 引入

View File

@ -1,8 +1,12 @@
# Circle
### Intro
Circular progress bar component, and supports gradient color animation.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -6,7 +6,7 @@ Quickly and easily create layouts with `van-row` and `van-col`.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Collapse
### Intro
Place a group of content in multiple collapsible panels, click the title of the panel to expand or contract its content.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# ContactCard
### Intro
Display contact information in the form of cards.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,7 @@
import { watch, reactive, PropType, defineComponent } from 'vue';
// Utils
import { createNamespace } from '../utils';
import { isMobile } from '../utils/validate/mobile';
import { isMobile, createNamespace } from '../utils';
// Components
import { Cell } from '../cell';

View File

@ -1,8 +1,12 @@
# ContactEdit
### Intro
Edit and save the contact information.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# ContactList
### Intro
Used to display the contact list.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# CountDown
### Intro
Used to display the countdown value in real time, and precision supports milliseconds.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Coupon
### Intro
Used for redemption and selection of coupons.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,5 +1,9 @@
# Coupon 优惠券选择器
### 介绍
用于优惠券的兑换和选择。
### 引入
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。

View File

@ -9,10 +9,10 @@ import {
} from 'vue';
// Utils
import { isDate } from '../utils/validate/date';
import {
pick,
range,
isDate,
padZero,
createNamespace,
ComponentInstance,

View File

@ -6,7 +6,7 @@ Used to select time, support date and time dimensions, usually used with the [Po
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,5 +1,4 @@
import { PropType } from 'vue';
import { isNaN } from '../utils/validate/number';
import { pickerProps } from '../picker/Picker';
export type ColumnType = 'year' | 'month' | 'day' | 'hour' | 'minute';
@ -42,7 +41,7 @@ export function getTrueValue(value: string | undefined): number {
return 0;
}
while (isNaN(parseInt(value, 10))) {
while (Number.isNaN(parseInt(value, 10))) {
if (value.length > 1) {
value = value.slice(1);
} else {

View File

@ -1,8 +1,12 @@
# Dialog
### Intro
A modal box pops up on the page, which is often used for message prompts, message confirmation, or to complete specific interactive operations in the current page. It supports two methods: function call and component call.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -2,9 +2,7 @@
### 介绍
弹出模态框,常用于消息提示、消息确认,或在当前页面内完成特定的交互操作。
弹出框组件支持函数调用和组件调用两种方式。
弹出模态框,常用于消息提示、消息确认,或在当前页面内完成特定的交互操作,支持函数调用和组件调用两种方式。
### 函数调用

View File

@ -1,8 +1,12 @@
# Divider
### Intro
Separate content into multiple areas.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# DropdownMenu
### Intro
The menu list that pops down downwards.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Empty
### Intro
Occupation reminder when empty.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Field
### Intro
Field component let users enter and edit text.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -2,7 +2,7 @@
### 介绍
表单中的输入框组件
用户可以在文本框内输入或编辑文字
### 引入

View File

@ -1,8 +1,12 @@
# Form
### Intro
Used for data entry and verification, and supports input boxes, radio buttons, check boxes, file uploads and other types.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Grid
### Intro
Used to divide the page into blocks of equal width in the horizontal direction for displaying content or page navigation.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Icon
### Intro
The font-based icon set that can be used via the Icon component or referenced in other components via the `icon` attribute.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# ImagePreview
### Intro
Used to zoom in and preview the picture, and it supports two methods: function call and component call.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Image
### Intro
Enhanced img tag with multiple image fill modes, support for image lazy loading, loading hint, loading failure hint.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# IndexBar
### Intro
Used for indexed sorting display and quick positioning of lists.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,5 +1,9 @@
# IndexBar 索引栏
### 介绍
用于列表的索引分类显示和快速定位。
### 引入
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。

View File

@ -1,8 +1,12 @@
# Lazyload
### Intro
When the page needs to load a large amount of content, delay loading the content outside the visible area of the page to make the page load smoother.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,5 +1,9 @@
# Lazyload 懒加载
### 介绍
当页面需要加载大量内容时,使用懒加载可以实现延迟加载页面可视区域外的内容,从而使页面加载更流畅。
### 引入
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。

View File

@ -6,7 +6,7 @@ A list component to show items and control loading status.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Loading
### Intro
Used to indicate the transition state during loading.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# NavBar
### Intro
Provide navigation function for the page, often used at the top of the page.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,5 +1,9 @@
# NavBar 导航栏
### 介绍
为页面提供导航功能,常用于页面顶部。
### 引入
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。

View File

@ -1,8 +1,12 @@
# NoticeBar
### Intro
Used to display a group of message notifications in a continuons loop.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Notify
### Intro
The display message prompt is at the top of the page, and supports two methods: function call and component call.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# NumberKeyboard
### Intro
The numberkeyboard component can be used with [PasswordInput](#/en-US/password-input) components or custom input box components.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Overlay
### Intro
Create a mask layer to emphasize specific page elements and prevent users from performing other operations.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Pagination
### Intro
When the amount of data is too much, use pagination to separate the data, and load only one page at a time.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,5 +1,9 @@
# Pagination 分页
### 介绍
数据量过多时,采用分页的形式将数据分隔,每次只加载一个页面。
### 引入
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。

View File

@ -2,11 +2,11 @@
### Intro
The PasswordInput component is usually used with [NumberKeyboard](#/en-US/number-keyboard) Component.
The passwordinput component is usually used with [NumberKeyboard](#/en-US/number-keyboard) Component.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -2,11 +2,11 @@
### Intro
The Picker component is usually used with [Popup](#/en-US/popup) Component.
The picker component is usually used with [Popup](#/en-US/popup) Component.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Popover
### Intro
Used to display some content on top of another.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Popup
### Intro
Used to display pop-up windows, information prompts, etc., and supports multiple pop-up layers to display.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Progress
### Intro
Used to show the current progress of the operation.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# PullRefresh
### Intro
Used to provide interactive operations for pull-down refresh.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Radio
### Intro
Single selection among multiple options.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -2,7 +2,7 @@
### 介绍
用于在多个选项中选择单个结果
在一组备选项中进行单选
### 引入

View File

@ -1,8 +1,12 @@
# Rate
### Intro
The rate component is used for rating things.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Search
### Intro
Input box component for search scenarios.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# ShareSheet
### Intro
A pop-up sharing panel at the bottom for displaying the action buttons corresponding to each sharing channel, without specific sharing logic.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Sidebar
### Intro
The vertically displayed navigation bar is used to switch between different content areas.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Skeleton
### Intro
Used to display a set of placeholder graphics during the content loading process.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Slider
### Intro
Used to select a value within a given range.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Stepper
### Intro
The stepper component consists of an increase button, a decrease button and an input box, which are used to input and adjust numbers within a certain range.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,7 +1,6 @@
import { ref, watch, computed, PropType, defineComponent } from 'vue';
// Utils
import { isNaN } from '../utils/validate/number';
import {
isDef,
addUnit,
@ -106,7 +105,7 @@ export default defineComponent({
value = formatNumber(String(value), !props.integer);
value = value === '' ? 0 : +value;
value = isNaN(value) ? +min : value;
value = Number.isNaN(value) ? +min : value;
value = Math.max(Math.min(+max, value), +min);
// format decimal

View File

@ -1,8 +1,12 @@
# Steps
### Intro
Used to show the various parts of the action flow and let the user know where the current action fits into the overall flow.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Sticky
### Intro
The sticky component is consistent with the effect achieved by the `position: sticky` property in CSS, in that when the component is within screen range, it will follow the normal layout arrangement, and when the component rolls out of screen range, it will always be fixed at the top of the screen.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# SubmitBar
### Intro
Used to display the order amount and submit the order.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,5 +1,9 @@
# SubmitBar 提交订单栏
### 介绍
用于展示订单金额与提交订单。
### 引入
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
@ -95,11 +99,11 @@ export default {
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| price | 价格(单位分) | _number_ | - |
| decimal-length | 价格小数点位数 | _number \| string_ | `2` |
| label | 价格左侧文案 | _string_ | `合计:` |
| suffix-label | 价格右侧文案 | _string_ | - |
| text-align | 价格文案对齐方向,可选值为 `left` | _string_ | `right` |
| price | 金额(单位分) | _number_ | - |
| decimal-length | 金额小数点位数 | _number \| string_ | `2` |
| label | 金额左侧文案 | _string_ | `合计:` |
| suffix-label | 金额右侧文案 | _string_ | - |
| text-align | 金额文案对齐方向,可选值为 `left` | _string_ | `right` |
| button-text | 按钮文字 | _string_ | - |
| button-type | 按钮类型 | _string_ | `danger` |
| button-color | 自定义按钮颜色 | _string_ | - |

View File

@ -1,8 +1,12 @@
# SwipeCell
### Intro
Used for cell components that can slide left and right to display operation buttons.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Swipe
### Intro
Used to loop a group of pictures or content.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Switch
### Intro
Used to switch between open and closed states.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Tab
### Intro
Used to switch between different content areas.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Tabbar
### Intro
Used to switch between different pages.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# Tag
### Intro
Used to mark keywords and summarize the main content.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,5 +1,9 @@
# Tag 标签
### 介绍
用于标记关键词和概括主要内容。
### 引入
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。

View File

@ -1,8 +1,12 @@
# Toast
### Intro
Black semi-transparent pop-up hint in the middle of the page, used for message notification, loading hint, operation result hint and other scenarios.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,8 +1,12 @@
# TreeSelect
### Intro
Used to select from a set of related data sets.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -1,5 +1,9 @@
# TreeSelect 分类选择
### 介绍
用于从一组相关联的数据集合中进行选择。
### 引入
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。

View File

@ -1,8 +1,12 @@
# Uploader
### Intro
Used to upload a local image or file to the server and display a preview image and upload progress during the upload process. The Uploader component does not currently contain the interface logic for uploading files to the server, this step needs to be implemented by the user.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways。
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';

View File

@ -10,23 +10,6 @@ export const UnknownProp = (null as unknown) as PropType<unknown>;
// eslint-disable-next-line
export type ComponentInstance = ComponentPublicInstance<{}, any>;
export function isDef<T>(val: T): val is NonNullable<T> {
return val !== undefined && val !== null;
}
// eslint-disable-next-line @typescript-eslint/ban-types
export function isFunction(val: unknown): val is Function {
return typeof val === 'function';
}
export function isObject(val: unknown): val is Record<any, any> {
return val !== null && typeof val === 'object';
}
export function isPromise<T = any>(val: unknown): val is Promise<T> {
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
}
export function get(object: any, path: string): any {
const keys = path.split('.');
let result = object;
@ -38,7 +21,7 @@ export function get(object: any, path: string): any {
return result;
}
type Writeable<T> = { -readonly [P in keyof T]: T[P] };
export type Writeable<T> = { -readonly [P in keyof T]: T[P] };
export function pick<T, U extends keyof T>(
obj: T,

View File

@ -1,5 +1,6 @@
import { get, isFunction } from '../base';
import { get } from '../base';
import { camelize } from '../format/string';
import { isFunction } from '../validate';
import locale from '../../locale';
export function createTranslate(name: string) {

View File

@ -1,4 +1,4 @@
import { isDef, isObject } from './base';
import { isDef, isObject } from './validate';
type ObjectIndex = Record<string, any>;

View File

@ -1,4 +1,4 @@
import { isDef } from './base';
import { isDef } from './validate';
export function deepClone<T extends Record<string, any> | null | undefined>(
obj: T

View File

@ -1,4 +1,4 @@
import { isIOS as checkIsIOS } from '../validate/system';
import { isIOS as checkIsIOS } from '../validate';
export type ScrollElement = Element | Window;

View File

@ -1,6 +1,6 @@
import { CSSProperties } from 'vue';
import { isDef, inBrowser } from '../base';
import { isNumeric } from '../validate/number';
import { inBrowser } from '../base';
import { isDef, isNumeric } from '../validate';
export function addUnit(value?: string | number): string | undefined {
if (!isDef(value)) {

View File

@ -1,5 +1,6 @@
export * from './base';
export * from './create';
export * from './validate';
export * from './with-install';
export * from './format/unit';
export * from './format/number';

View File

@ -1,13 +0,0 @@
import { App } from 'vue';
import { camelize } from './format/string';
export function installable<T>(options: T) {
return {
...options,
install(app: App) {
const { name } = options as any;
app.component(name, options);
app.component(camelize(`-${name}`), options);
},
};
}

View File

@ -1,9 +1,7 @@
import { deepClone } from '../deep-clone';
import { deepAssign } from '../deep-assign';
import { isDef, get, noop } from '..';
import { isMobile } from '../validate/mobile';
import { isNumeric } from '../validate/number';
import { isAndroid } from '../validate/system';
import { get, noop } from '..';
import { isDef, isMobile, isNumeric, isAndroid } from '../validate';
import { camelize } from '../format/string';
import { formatNumber } from '../format/number';
import { addUnit, unitToPx } from '../format/unit';

46
src/utils/validate.ts Normal file
View File

@ -0,0 +1,46 @@
import { inBrowser } from './base';
export function isDef<T>(val: T): val is NonNullable<T> {
return val !== undefined && val !== null;
}
// eslint-disable-next-line @typescript-eslint/ban-types
export function isFunction(val: unknown): val is Function {
return typeof val === 'function';
}
export function isObject(val: unknown): val is Record<any, any> {
return val !== null && typeof val === 'object';
}
export function isPromise<T = any>(val: unknown): val is Promise<T> {
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
}
export function isDate(val: unknown): val is Date {
return (
Object.prototype.toString.call(val) === '[object Date]' &&
!Number.isNaN((val as Date).getTime())
);
}
export function isMobile(value: string): boolean {
value = value.replace(/[^-|\d]/g, '');
return (
/^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value)
);
}
export function isNumeric(val: string | number): val is string {
return typeof val === 'number' || /^\d+(\.\d+)?$/.test(val);
}
export function isAndroid(): boolean {
return inBrowser ? /android/.test(navigator.userAgent.toLowerCase()) : false;
}
export function isIOS(): boolean {
return inBrowser
? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase())
: false;
}

View File

@ -1,8 +0,0 @@
import { isNaN } from './number';
export function isDate(val: unknown): val is Date {
return (
Object.prototype.toString.call(val) === '[object Date]' &&
!isNaN((val as Date).getTime())
);
}

View File

@ -1,6 +0,0 @@
export function isMobile(value: string): boolean {
value = value.replace(/[^-|\d]/g, '');
return (
/^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value)
);
}

Some files were not shown because too many files have changed in this diff Show More