mirror of
https://gitee.com/vant-contrib/vant.git
synced 2026-07-11 16:41:05 +08:00
Compare commits
2 Commits
ca1aa1a7b1
...
8a97278cda
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a97278cda | ||
|
|
ddc0e09b69 |
21
README.md
21
README.md
@ -27,16 +27,17 @@
|
||||
|
||||
## Features
|
||||
|
||||
- 65+ Reusable components
|
||||
- 1kb Component average size (min+gzip)
|
||||
- 90%+ Unit test coverage
|
||||
- Extensive documentation and demos
|
||||
- Support Vue 2 & Vue 3
|
||||
- Support Tree Shaking
|
||||
- Support Custom Theme
|
||||
- Support i18n
|
||||
- Support TS
|
||||
- Support SSR
|
||||
- 🚀 1KB Component average size (min+gzip)
|
||||
- 🚀 65+ High quality components
|
||||
- 💪 90%+ Unit test coverage
|
||||
- 💪 Written in TypeScript
|
||||
- 📖 Extensive documentation and demos
|
||||
- 📖 Provide Sketch and Axure design resources
|
||||
- 🍭 Support Vue 2 & Vue 3
|
||||
- 🍭 Support Tree Shaking
|
||||
- 🍭 Support Custom Theme
|
||||
- 🍭 Support i18n
|
||||
- 🌍 Support SSR
|
||||
|
||||
## Install
|
||||
|
||||
|
||||
@ -31,16 +31,17 @@ Vant 是**有赞前端团队**开源的移动端组件库,于 2017 年开源
|
||||
|
||||
## 特性
|
||||
|
||||
- 提供 60 多个高质量组件,覆盖移动端各类场景
|
||||
- 性能极佳,组件平均体积不到 1kb(min+gzip)
|
||||
- 单元测试覆盖率 90%+,提供稳定性保障
|
||||
- 完善的中英文文档和示例
|
||||
- 支持 Vue 2 & Vue 3
|
||||
- 支持按需引入
|
||||
- 支持主题定制
|
||||
- 支持国际化
|
||||
- 支持 TypeScript
|
||||
- 支持 SSR
|
||||
- 🚀 性能极佳,组件平均体积小于 1KB(min+gzip)
|
||||
- 🚀 65+ 个高质量组件,覆盖移动端主流场景
|
||||
- 💪 使用 TypeScript 编写,提供完整的类型定义
|
||||
- 💪 单元测试覆盖率超过 90%,提供稳定性保障
|
||||
- 📖 提供完善的中英文文档和组件示例
|
||||
- 📖 提供 Sketch 和 Axure 设计资源
|
||||
- 🍭 支持 Vue 2、Vue 3 和微信小程序
|
||||
- 🍭 支持主题定制,内置 700+ 个主题变量
|
||||
- 🍭 支持按需引入和 Tree Shaking
|
||||
- 🍭 支持服务器端渲染
|
||||
- 🌍 支持国际化和语言包定制
|
||||
|
||||
## 安装
|
||||
|
||||
|
||||
@ -8,16 +8,17 @@
|
||||
|
||||
### Features
|
||||
|
||||
- 65+ Reusable components
|
||||
- 1kb Component average size (min+gzip)
|
||||
- 90%+ Unit test coverage
|
||||
- Extensive documentation and demos
|
||||
- Support Vue 2 & Vue 3
|
||||
- Support Tree Shaking
|
||||
- Support Custom Theme
|
||||
- Support i18n
|
||||
- Support TS
|
||||
- Support SSR
|
||||
- 🚀 1KB Component average size (min+gzip)
|
||||
- 🚀 65+ High quality components
|
||||
- 💪 90%+ Unit test coverage
|
||||
- 💪 Written in TypeScript
|
||||
- 📖 Extensive documentation and demos
|
||||
- 📖 Provide Sketch and Axure design resources
|
||||
- 🍭 Support Vue 2 & Vue 3
|
||||
- 🍭 Support Tree Shaking
|
||||
- 🍭 Support Custom Theme
|
||||
- 🍭 Support i18n
|
||||
- 🌍 Support SSR
|
||||
|
||||
### Quickstart
|
||||
|
||||
|
||||
@ -18,16 +18,17 @@ Vant 是**有赞前端团队**开源的移动端组件库,于 2017 年开源
|
||||
|
||||
### 特性
|
||||
|
||||
- 提供 60 多个高质量组件,覆盖移动端各类场景
|
||||
- 性能极佳,组件平均体积不到 1kb(min+gzip)
|
||||
- 单元测试覆盖率 90%+,提供稳定性保障
|
||||
- 完善的中英文文档和示例
|
||||
- 支持 Vue 2 & Vue 3
|
||||
- 支持按需引入
|
||||
- 支持主题定制
|
||||
- 支持国际化
|
||||
- 支持 TypeScript
|
||||
- 支持 SSR
|
||||
- 🚀 性能极佳,组件平均体积小于 1KB(min+gzip)
|
||||
- 🚀 65+ 个高质量组件,覆盖移动端主流场景
|
||||
- 💪 使用 TypeScript 编写,提供完整的类型定义
|
||||
- 💪 单元测试覆盖率超过 90%,提供稳定性保障
|
||||
- 📖 提供完善的中英文文档和组件示例
|
||||
- 📖 提供 Sketch 和 Axure 设计资源
|
||||
- 🍭 支持 Vue 2、Vue 3 和微信小程序
|
||||
- 🍭 支持主题定制,内置 700+ 个主题变量
|
||||
- 🍭 支持按需引入和 Tree Shaking
|
||||
- 🍭 支持服务器端渲染
|
||||
- 🌍 支持国际化和语言包定制
|
||||
|
||||
### 快速上手
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import { HTMLAttributes, InputHTMLAttributes } from 'vue';
|
||||
import {
|
||||
trigger,
|
||||
isObject,
|
||||
isPromise,
|
||||
isFunction,
|
||||
@ -50,15 +49,14 @@ export function getRuleMessage(value: unknown, rule: FieldRule) {
|
||||
return message || '';
|
||||
}
|
||||
|
||||
export function startComposing(event: Event) {
|
||||
event.target!.composing = true;
|
||||
export function startComposing({ target }: Event) {
|
||||
target!.composing = true;
|
||||
}
|
||||
|
||||
export function endComposing(event: Event) {
|
||||
const { target } = event;
|
||||
export function endComposing({ target }: Event) {
|
||||
if (target!.composing) {
|
||||
target!.composing = false;
|
||||
trigger(target as Element, 'input');
|
||||
target!.dispatchEvent(new Event('input'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import { createApp } from 'vue';
|
||||
import { later } from '../../../test';
|
||||
import { trigger } from '../../utils';
|
||||
import { Notify } from '../function-call';
|
||||
import NotifyComponent from '../Notify';
|
||||
|
||||
@ -65,6 +64,6 @@ test('should call onClick option when clicked', async () => {
|
||||
|
||||
await later();
|
||||
const notify = document.querySelector('.van-notify');
|
||||
trigger(notify, 'click');
|
||||
notify.click();
|
||||
expect(onClick).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
@ -66,12 +66,6 @@ export function preventDefault(event: Event, isStopPropagation?: boolean) {
|
||||
}
|
||||
}
|
||||
|
||||
export function trigger(target: Element, type: string) {
|
||||
const inputEvent = document.createEvent('HTMLEvents');
|
||||
inputEvent.initEvent(type, true, true);
|
||||
target.dispatchEvent(inputEvent);
|
||||
}
|
||||
|
||||
export function isHidden(
|
||||
elementRef: HTMLElement | Ref<HTMLElement | undefined>
|
||||
) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user