mirror of
https://gitee.com/vant-contrib/vant.git
synced 2026-01-10 16:39:09 +08:00
Compare commits
7 Commits
542818f020
...
3214b1dd80
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3214b1dd80 | ||
|
|
9f93dd9d61 | ||
|
|
56429ad4e1 | ||
|
|
0c6f7c63a7 | ||
|
|
55afff0e9c | ||
|
|
2210f8240d | ||
|
|
cf7eadc6b2 |
@ -1,8 +1,12 @@
|
|||||||
# ActionBar
|
# ActionBar
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to provide convenient interaction for page-related operations.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
# ActionBar 动作栏
|
# ActionBar 动作栏
|
||||||
|
|
||||||
|
### 介绍
|
||||||
|
|
||||||
|
用于为页面相关操作提供便捷交互。
|
||||||
|
|
||||||
### 引入
|
### 引入
|
||||||
|
|
||||||
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# ActionSheet
|
# ActionSheet
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
The pop-up modal panel at the bottom contains multiple options related to the current situation.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -9,8 +9,12 @@ import {
|
|||||||
} from 'vue';
|
} from 'vue';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { ComponentInstance, createNamespace, isObject } from '../utils';
|
import {
|
||||||
import { isMobile } from '../utils/validate/mobile';
|
isObject,
|
||||||
|
isMobile,
|
||||||
|
createNamespace,
|
||||||
|
ComponentInstance,
|
||||||
|
} from '../utils';
|
||||||
|
|
||||||
// Composables
|
// Composables
|
||||||
import { useExpose } from '../composables/use-expose';
|
import { useExpose } from '../composables/use-expose';
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
import { PropType, ref, defineComponent } from 'vue';
|
import { PropType, ref, defineComponent } from 'vue';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { ComponentInstance, createNamespace } from '../utils';
|
import { isAndroid, ComponentInstance, createNamespace } from '../utils';
|
||||||
import { isAndroid } from '../utils/validate/system';
|
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
import { Cell } from '../cell';
|
import { Cell } from '../cell';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# AddressEdit
|
# AddressEdit
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to create, update, and delete receiving addresses.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
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
|
### Area Data Structure
|
||||||
|
|
||||||
Please refer to [Area](#/en-US/area) component。
|
Please refer to [Area](#/en-US/area) component.
|
||||||
|
|
||||||
### Less Variables
|
### Less Variables
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# AddressList
|
# AddressList
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Display a list of receiving addresses.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
### Intro
|
### 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
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
import { PropType, CSSProperties, defineComponent } from 'vue';
|
import { PropType, CSSProperties, defineComponent } from 'vue';
|
||||||
import { isDef, createNamespace } from '../utils';
|
import { isDef, isNumeric, createNamespace } from '../utils';
|
||||||
import { isNumeric } from '../utils/validate/number';
|
|
||||||
|
|
||||||
const [name, bem] = createNamespace('badge');
|
const [name, bem] = createNamespace('badge');
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Badge
|
# Badge
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Display a small badge or a red dot to the top-right of its child.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Button
|
# Button
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Buttons are used to trigger an action, such as submitting a form.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -9,8 +9,7 @@ import {
|
|||||||
} from 'vue';
|
} from 'vue';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { pick, getScrollTop, ComponentInstance } from '../utils';
|
import { pick, isDate, getScrollTop, ComponentInstance } from '../utils';
|
||||||
import { isDate } from '../utils/validate/date';
|
|
||||||
import {
|
import {
|
||||||
t,
|
t,
|
||||||
bem,
|
bem,
|
||||||
|
|||||||
@ -6,7 +6,7 @@ Calendar component for selecting dates or date ranges.
|
|||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Card
|
# Card
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to display product pictures, prices and other information.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Cascader
|
# 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
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Cell
|
# Cell
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
The cell is a single display item in the list.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Checkbox
|
# Checkbox
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
A group of options for multiple choices.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
### 介绍
|
### 介绍
|
||||||
|
|
||||||
用于在选中和非选中状态之间进行切换。
|
在一组备选项中进行多选。
|
||||||
|
|
||||||
### 引入
|
### 引入
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Circle
|
# Circle
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Circular progress bar component, and supports gradient color animation.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -6,7 +6,7 @@ Quickly and easily create layouts with `van-row` and `van-col`.
|
|||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Collapse
|
# Collapse
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Place a group of content in multiple collapsible panels, click the title of the panel to expand or contract its content.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# ContactCard
|
# ContactCard
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Display contact information in the form of cards.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
import { watch, reactive, PropType, defineComponent } from 'vue';
|
import { watch, reactive, PropType, defineComponent } from 'vue';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { createNamespace } from '../utils';
|
import { isMobile, createNamespace } from '../utils';
|
||||||
import { isMobile } from '../utils/validate/mobile';
|
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
import { Cell } from '../cell';
|
import { Cell } from '../cell';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# ContactEdit
|
# ContactEdit
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Edit and save the contact information.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# ContactList
|
# ContactList
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to display the contact list.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# CountDown
|
# CountDown
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to display the countdown value in real time, and precision supports milliseconds.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Coupon
|
# Coupon
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used for redemption and selection of coupons.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
# Coupon 优惠券选择器
|
# Coupon 优惠券选择器
|
||||||
|
|
||||||
|
### 介绍
|
||||||
|
|
||||||
|
用于优惠券的兑换和选择。
|
||||||
|
|
||||||
### 引入
|
### 引入
|
||||||
|
|
||||||
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
||||||
|
|||||||
@ -9,10 +9,10 @@ import {
|
|||||||
} from 'vue';
|
} from 'vue';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { isDate } from '../utils/validate/date';
|
|
||||||
import {
|
import {
|
||||||
pick,
|
pick,
|
||||||
range,
|
range,
|
||||||
|
isDate,
|
||||||
padZero,
|
padZero,
|
||||||
createNamespace,
|
createNamespace,
|
||||||
ComponentInstance,
|
ComponentInstance,
|
||||||
|
|||||||
@ -6,7 +6,7 @@ Used to select time, support date and time dimensions, usually used with the [Po
|
|||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { PropType } from 'vue';
|
import { PropType } from 'vue';
|
||||||
import { isNaN } from '../utils/validate/number';
|
|
||||||
import { pickerProps } from '../picker/Picker';
|
import { pickerProps } from '../picker/Picker';
|
||||||
|
|
||||||
export type ColumnType = 'year' | 'month' | 'day' | 'hour' | 'minute';
|
export type ColumnType = 'year' | 'month' | 'day' | 'hour' | 'minute';
|
||||||
@ -42,7 +41,7 @@ export function getTrueValue(value: string | undefined): number {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (isNaN(parseInt(value, 10))) {
|
while (Number.isNaN(parseInt(value, 10))) {
|
||||||
if (value.length > 1) {
|
if (value.length > 1) {
|
||||||
value = value.slice(1);
|
value = value.slice(1);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Dialog
|
# 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
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
### 介绍
|
### 介绍
|
||||||
|
|
||||||
弹出模态框,常用于消息提示、消息确认,或在当前页面内完成特定的交互操作。
|
弹出模态框,常用于消息提示、消息确认,或在当前页面内完成特定的交互操作,支持函数调用和组件调用两种方式。
|
||||||
|
|
||||||
弹出框组件支持函数调用和组件调用两种方式。
|
|
||||||
|
|
||||||
### 函数调用
|
### 函数调用
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Divider
|
# Divider
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Separate content into multiple areas.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# DropdownMenu
|
# DropdownMenu
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
The menu list that pops down downwards.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Empty
|
# Empty
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Occupation reminder when empty.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Field
|
# Field
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Field component let users enter and edit text.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
### 介绍
|
### 介绍
|
||||||
|
|
||||||
表单中的输入框组件。
|
用户可以在文本框内输入或编辑文字。
|
||||||
|
|
||||||
### 引入
|
### 引入
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Form
|
# Form
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used for data entry and verification, and supports input boxes, radio buttons, check boxes, file uploads and other types.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Grid
|
# Grid
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to divide the page into blocks of equal width in the horizontal direction for displaying content or page navigation.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Icon
|
# 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
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# ImagePreview
|
# ImagePreview
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to zoom in and preview the picture, and it supports two methods: function call and component call.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Image
|
# Image
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Enhanced img tag with multiple image fill modes, support for image lazy loading, loading hint, loading failure hint.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# IndexBar
|
# IndexBar
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used for indexed sorting display and quick positioning of lists.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
# IndexBar 索引栏
|
# IndexBar 索引栏
|
||||||
|
|
||||||
|
### 介绍
|
||||||
|
|
||||||
|
用于列表的索引分类显示和快速定位。
|
||||||
|
|
||||||
### 引入
|
### 引入
|
||||||
|
|
||||||
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Lazyload
|
# 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
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
# Lazyload 懒加载
|
# Lazyload 懒加载
|
||||||
|
|
||||||
|
### 介绍
|
||||||
|
|
||||||
|
当页面需要加载大量内容时,使用懒加载可以实现延迟加载页面可视区域外的内容,从而使页面加载更流畅。
|
||||||
|
|
||||||
### 引入
|
### 引入
|
||||||
|
|
||||||
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
||||||
|
|||||||
@ -6,7 +6,7 @@ A list component to show items and control loading status.
|
|||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Loading
|
# Loading
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to indicate the transition state during loading.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# NavBar
|
# NavBar
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Provide navigation function for the page, often used at the top of the page.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
# NavBar 导航栏
|
# NavBar 导航栏
|
||||||
|
|
||||||
|
### 介绍
|
||||||
|
|
||||||
|
为页面提供导航功能,常用于页面顶部。
|
||||||
|
|
||||||
### 引入
|
### 引入
|
||||||
|
|
||||||
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# NoticeBar
|
# NoticeBar
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to display a group of message notifications in a continuons loop.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Notify
|
# Notify
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
The display message prompt is at the top of the page, and supports two methods: function call and component call.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# NumberKeyboard
|
# NumberKeyboard
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
The numberkeyboard component can be used with [PasswordInput](#/en-US/password-input) components or custom input box components.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Overlay
|
# Overlay
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Create a mask layer to emphasize specific page elements and prevent users from performing other operations.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Pagination
|
# 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
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
# Pagination 分页
|
# Pagination 分页
|
||||||
|
|
||||||
|
### 介绍
|
||||||
|
|
||||||
|
数据量过多时,采用分页的形式将数据分隔,每次只加载一个页面。
|
||||||
|
|
||||||
### 引入
|
### 引入
|
||||||
|
|
||||||
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
### Intro
|
### 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
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
### Intro
|
### 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
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Popover
|
# Popover
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to display some content on top of another.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Popup
|
# Popup
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to display pop-up windows, information prompts, etc., and supports multiple pop-up layers to display.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Progress
|
# Progress
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to show the current progress of the operation.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# PullRefresh
|
# PullRefresh
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to provide interactive operations for pull-down refresh.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Radio
|
# Radio
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Single selection among multiple options.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
### 介绍
|
### 介绍
|
||||||
|
|
||||||
用于在多个选项中选择单个结果。
|
在一组备选项中进行单选。
|
||||||
|
|
||||||
### 引入
|
### 引入
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Rate
|
# Rate
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
The rate component is used for rating things.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Search
|
# Search
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Input box component for search scenarios.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# ShareSheet
|
# 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
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Sidebar
|
# Sidebar
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
The vertically displayed navigation bar is used to switch between different content areas.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Skeleton
|
# Skeleton
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to display a set of placeholder graphics during the content loading process.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Slider
|
# Slider
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to select a value within a given range.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Stepper
|
# 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
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
import { ref, watch, computed, PropType, defineComponent } from 'vue';
|
import { ref, watch, computed, PropType, defineComponent } from 'vue';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { isNaN } from '../utils/validate/number';
|
|
||||||
import {
|
import {
|
||||||
isDef,
|
isDef,
|
||||||
addUnit,
|
addUnit,
|
||||||
@ -106,7 +105,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
value = formatNumber(String(value), !props.integer);
|
value = formatNumber(String(value), !props.integer);
|
||||||
value = value === '' ? 0 : +value;
|
value = value === '' ? 0 : +value;
|
||||||
value = isNaN(value) ? +min : value;
|
value = Number.isNaN(value) ? +min : value;
|
||||||
value = Math.max(Math.min(+max, value), +min);
|
value = Math.max(Math.min(+max, value), +min);
|
||||||
|
|
||||||
// format decimal
|
// format decimal
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Steps
|
# 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
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Sticky
|
# 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
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# SubmitBar
|
# SubmitBar
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to display the order amount and submit the order.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
# SubmitBar 提交订单栏
|
# SubmitBar 提交订单栏
|
||||||
|
|
||||||
|
### 介绍
|
||||||
|
|
||||||
|
用于展示订单金额与提交订单。
|
||||||
|
|
||||||
### 引入
|
### 引入
|
||||||
|
|
||||||
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
||||||
@ -95,11 +99,11 @@ export default {
|
|||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| price | 价格(单位分) | _number_ | - |
|
| price | 金额(单位分) | _number_ | - |
|
||||||
| decimal-length | 价格小数点位数 | _number \| string_ | `2` |
|
| decimal-length | 金额小数点位数 | _number \| string_ | `2` |
|
||||||
| label | 价格左侧文案 | _string_ | `合计:` |
|
| label | 金额左侧文案 | _string_ | `合计:` |
|
||||||
| suffix-label | 价格右侧文案 | _string_ | - |
|
| suffix-label | 金额右侧文案 | _string_ | - |
|
||||||
| text-align | 价格文案对齐方向,可选值为 `left` | _string_ | `right` |
|
| text-align | 金额文案对齐方向,可选值为 `left` | _string_ | `right` |
|
||||||
| button-text | 按钮文字 | _string_ | - |
|
| button-text | 按钮文字 | _string_ | - |
|
||||||
| button-type | 按钮类型 | _string_ | `danger` |
|
| button-type | 按钮类型 | _string_ | `danger` |
|
||||||
| button-color | 自定义按钮颜色 | _string_ | - |
|
| button-color | 自定义按钮颜色 | _string_ | - |
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# SwipeCell
|
# SwipeCell
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used for cell components that can slide left and right to display operation buttons.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Swipe
|
# Swipe
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to loop a group of pictures or content.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Switch
|
# Switch
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to switch between open and closed states.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Tab
|
# Tab
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to switch between different content areas.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Tabbar
|
# Tabbar
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to switch between different pages.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Tag
|
# Tag
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to mark keywords and summarize the main content.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
# Tag 标签
|
# Tag 标签
|
||||||
|
|
||||||
|
### 介绍
|
||||||
|
|
||||||
|
用于标记关键词和概括主要内容。
|
||||||
|
|
||||||
### 引入
|
### 引入
|
||||||
|
|
||||||
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Toast
|
# 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
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# TreeSelect
|
# TreeSelect
|
||||||
|
|
||||||
|
### Intro
|
||||||
|
|
||||||
|
Used to select from a set of related data sets.
|
||||||
|
|
||||||
### Install
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
# TreeSelect 分类选择
|
# TreeSelect 分类选择
|
||||||
|
|
||||||
|
### 介绍
|
||||||
|
|
||||||
|
用于从一组相关联的数据集合中进行选择。
|
||||||
|
|
||||||
### 引入
|
### 引入
|
||||||
|
|
||||||
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
通过以下方式来全局注册组件,更多注册方式请参考[组件注册](#/zh-CN/advanced-usage#zu-jian-zhu-ce)。
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
# Uploader
|
# 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
|
### 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
|
```js
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
|
|||||||
@ -10,23 +10,6 @@ export const UnknownProp = (null as unknown) as PropType<unknown>;
|
|||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
export type ComponentInstance = ComponentPublicInstance<{}, any>;
|
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 {
|
export function get(object: any, path: string): any {
|
||||||
const keys = path.split('.');
|
const keys = path.split('.');
|
||||||
let result = object;
|
let result = object;
|
||||||
@ -38,7 +21,7 @@ export function get(object: any, path: string): any {
|
|||||||
return result;
|
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>(
|
export function pick<T, U extends keyof T>(
|
||||||
obj: T,
|
obj: T,
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { get, isFunction } from '../base';
|
import { get } from '../base';
|
||||||
import { camelize } from '../format/string';
|
import { camelize } from '../format/string';
|
||||||
|
import { isFunction } from '../validate';
|
||||||
import locale from '../../locale';
|
import locale from '../../locale';
|
||||||
|
|
||||||
export function createTranslate(name: string) {
|
export function createTranslate(name: string) {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { isDef, isObject } from './base';
|
import { isDef, isObject } from './validate';
|
||||||
|
|
||||||
type ObjectIndex = Record<string, any>;
|
type ObjectIndex = Record<string, any>;
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { isDef } from './base';
|
import { isDef } from './validate';
|
||||||
|
|
||||||
export function deepClone<T extends Record<string, any> | null | undefined>(
|
export function deepClone<T extends Record<string, any> | null | undefined>(
|
||||||
obj: T
|
obj: T
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { isIOS as checkIsIOS } from '../validate/system';
|
import { isIOS as checkIsIOS } from '../validate';
|
||||||
|
|
||||||
export type ScrollElement = Element | Window;
|
export type ScrollElement = Element | Window;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { CSSProperties } from 'vue';
|
import { CSSProperties } from 'vue';
|
||||||
import { isDef, inBrowser } from '../base';
|
import { inBrowser } from '../base';
|
||||||
import { isNumeric } from '../validate/number';
|
import { isDef, isNumeric } from '../validate';
|
||||||
|
|
||||||
export function addUnit(value?: string | number): string | undefined {
|
export function addUnit(value?: string | number): string | undefined {
|
||||||
if (!isDef(value)) {
|
if (!isDef(value)) {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
export * from './base';
|
export * from './base';
|
||||||
export * from './create';
|
export * from './create';
|
||||||
|
export * from './validate';
|
||||||
export * from './with-install';
|
export * from './with-install';
|
||||||
export * from './format/unit';
|
export * from './format/unit';
|
||||||
export * from './format/number';
|
export * from './format/number';
|
||||||
|
|||||||
@ -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);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,9 +1,7 @@
|
|||||||
import { deepClone } from '../deep-clone';
|
import { deepClone } from '../deep-clone';
|
||||||
import { deepAssign } from '../deep-assign';
|
import { deepAssign } from '../deep-assign';
|
||||||
import { isDef, get, noop } from '..';
|
import { get, noop } from '..';
|
||||||
import { isMobile } from '../validate/mobile';
|
import { isDef, isMobile, isNumeric, isAndroid } from '../validate';
|
||||||
import { isNumeric } from '../validate/number';
|
|
||||||
import { isAndroid } from '../validate/system';
|
|
||||||
import { camelize } from '../format/string';
|
import { camelize } from '../format/string';
|
||||||
import { formatNumber } from '../format/number';
|
import { formatNumber } from '../format/number';
|
||||||
import { addUnit, unitToPx } from '../format/unit';
|
import { addUnit, unitToPx } from '../format/unit';
|
||||||
|
|||||||
46
src/utils/validate.ts
Normal file
46
src/utils/validate.ts
Normal 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;
|
||||||
|
}
|
||||||
@ -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())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -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
Loading…
x
Reference in New Issue
Block a user