Compare commits

...

11 Commits

Author SHA1 Message Date
chenjiahan
26fa234026 Merge branch 'dev' into next 2021-11-04 20:21:28 +08:00
chenjiahan
df1e6ce916 docs(changelog): 3.2.7 2021-11-04 20:21:02 +08:00
chenjiahan
610fc9a695 release: 3.2.7 2021-11-04 20:17:31 +08:00
chenjiahan
4f40157057 fix(@vant/cli): release plugin not work 2021-11-04 20:16:30 +08:00
neverland
30510c01c6
types(Cell): add CellSize type (#9802) 2021-11-04 19:34:51 +08:00
neverland
7d1b57fde3
fix(Overlay): should export OverlayProps type (#9801) 2021-11-04 19:28:11 +08:00
neverland
b08a3c0a61
chore(Cell): remove slot deprecation log (#9800) 2021-11-04 19:26:28 +08:00
chenjiahan
6c24fa728e docs: update v4 migration guide 2021-11-04 17:48:37 +08:00
neverland
113323cea2
docs: add @antmjs/vantui to ecosystem (#9798) 2021-11-04 17:42:19 +08:00
chenjiahan
0fedd1dbea Merge branch 'dev' into next 2021-11-04 11:26:29 +08:00
neverland
1389ca34b2
chore(@vant/cli): add margin for p tag (#9790) 2021-11-04 11:24:28 +08:00
18 changed files with 122 additions and 59 deletions

View File

@ -86,11 +86,12 @@ Vant 3 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3).
| Project | Description |
| --- | --- |
| [3lang3/react-vant](https://github.com/3lang3/react-vant) | React mobile UI Components base on Vant |
| [3lang3/react-vant](https://github.com/3lang3/react-vant) | React mobile UI Components based on Vant |
| [mxdi9i7/vant-react](https://github.com/mxdi9i7/vant-react) | Mobile UI Components built on React and TS, inspired by Vant |
| [vant-aliapp](https://github.com/ant-move/Vant-Aliapp) | Alipay MiniProgram UI |
| [taroify](https://gitee.com/mallfoundry/taroify) | Vant Taro |
| [vant-theme](https://github.com/Aisen60/vant-theme) | online theme preview built on Vant UI |
| [vant-theme](https://github.com/Aisen60/vant-theme) | Online theme preview built on Vant UI |
| [@antmjs/vantui](https://github.com/antmjs/vantui) | Mobile UI Components based on Vant, supporting Taro and React |
## Links

View File

@ -101,6 +101,7 @@ Vant 3 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一致
| [vant-aliapp](https://github.com/ant-move/Vant-Aliapp) | Vant 支付宝小程序版 |
| [taroify](https://gitee.com/mallfoundry/taroify) | Vant Taro 版 |
| [vant-theme](https://github.com/Aisen60/vant-theme) | Vant 在线主题预览工具 |
| [@antmjs/vantui](https://github.com/antmjs/vantui) | 基于 Vant Weapp 开发的多端组件库,同时支持 Taro 和 React |
## 链接

View File

@ -0,0 +1,14 @@
const releaseIt = require('release-it');
const { execSync } = require('child_process');
class VantCliReleasePlugin extends releaseIt.Plugin {
async beforeRelease() {
// log an empty line
console.log('');
execSync('vant-cli build', { stdio: 'inherit' });
execSync('vant-cli changelog', { stdio: 'inherit' });
}
}
module.exports = VantCliReleasePlugin;

View File

@ -98,6 +98,10 @@ export default {
font-size: 16px;
}
> p {
margin-top: 8px;
}
> p,
> blockquote p {
color: @van-doc-text-color;

View File

@ -4,7 +4,7 @@ import { join, dirname } from 'path';
import { fileURLToPath } from 'url';
const __dirname = dirname(fileURLToPath(import.meta.url));
const PLUGIN_PATH = join(__dirname, '../compiler/vant-cli-release-plugin.js');
const PLUGIN_PATH = join(__dirname, '../../cjs/vant-cli-release-plugin.cjs');
export async function release(command: { tag?: string }) {
await releaseIt({

View File

@ -1,15 +0,0 @@
import releaseIt from 'release-it';
import { build } from '../commands/build.js';
import { changelog } from '../commands/changelog.js';
class VantCliReleasePlugin extends releaseIt.Plugin {
async beforeRelease() {
// log an empty line
console.log('');
await build();
await changelog();
}
}
module.exports = VantCliReleasePlugin;

View File

@ -16,6 +16,24 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/).
## Details
### [v3.2.7](https://github.com/youzan/vant/compare/v3.2.6...v3.2.7)
`2021-11-04`
**Feature**
- export all props type [#9717](https://github.com/youzan/vant/issues/9717)
- add --van-text-color-2 CSS var [#9759](https://github.com/youzan/vant/issues/9759)
- add --van-text-color-3 CSS var [#9776](https://github.com/youzan/vant/issues/9776)
- Cascader: add options-top slot [#9732](https://github.com/youzan/vant/issues/9732)
- Coupon: add --van-coupon-content-text-color CSS var [#9760](https://github.com/youzan/vant/issues/9760)
- Picker: add --van-picker-mask-color CSS var [#9783](https://github.com/youzan/vant/issues/9783)
**Bug Fixes**
- Field: adjust textarea size when focus/blur [#9719](https://github.com/youzan/vant/issues/9719)
- fix --van-border-color should affect hairline [#9751](https://github.com/youzan/vant/issues/9751)
### [v3.2.6](https://github.com/youzan/vant/compare/v3.2.5...v3.2.6)
`2021-10-24`

View File

@ -16,6 +16,24 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。
## 更新内容
### [v3.2.7](https://github.com/youzan/vant/compare/v3.2.6...v3.2.7)
`2021-11-04`
**Feature**
- 导出所有组件的 Props 类型 [#9717](https://github.com/youzan/vant/issues/9717)
- 新增 --van-text-color-2 CSS 变量 [#9759](https://github.com/youzan/vant/issues/9759)
- 新增 --van-text-color-3 CSS 变量 [#9776](https://github.com/youzan/vant/issues/9776)
- Cascader: 新增 options-top 插槽 [#9732](https://github.com/youzan/vant/issues/9732)
- Coupon: 新增 --van-coupon-content-text-color CSS 变量 [#9760](https://github.com/youzan/vant/issues/9760)
- Picker: 新增 --van-picker-mask-color CSS 变量 [#9783](https://github.com/youzan/vant/issues/9783)
**Bug Fixes**
- Field: 修复 textarea 在聚焦和失焦时未重新计算高度的问题 [#9719](https://github.com/youzan/vant/issues/9719)
- 修复 --van-border-color 变量不生效的问题 [#9751](https://github.com/youzan/vant/issues/9751)
### [v3.2.6](https://github.com/youzan/vant/compare/v3.2.5...v3.2.6)
`2021-10-24`

View File

@ -48,11 +48,12 @@ Vant 3 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3).
| Project | Description |
| --- | --- |
| [3lang3/react-vant](https://github.com/3lang3/react-vant) | React mobile UI Components base on Vant |
| [3lang3/react-vant](https://github.com/3lang3/react-vant) | React mobile UI Components based on Vant |
| [mxdi9i7/vant-react](https://github.com/mxdi9i7/vant-react) | Mobile UI Components built on React and TS, inspired by Vant |
| [vant-aliapp](https://github.com/ant-move/Vant-Aliapp) | Alipay MiniProgram UI |
| [taroify](https://gitee.com/mallfoundry/taroify) | Vant Taro |
| [vant-theme](https://github.com/Aisen60/vant-theme) | online theme preview built on Vant UI |
| [vant-theme](https://github.com/Aisen60/vant-theme) | Online theme preview built on Vant UI |
| [@antmjs/vantui](https://github.com/antmjs/vantui) | Mobile UI Components based on Vant, supporting Taro and React |
### Links

View File

@ -8,7 +8,7 @@
### 介绍
Vant 是**有赞前端团队**开源的移动端组件库,于 2017 年开源,已持续维护 4 年时间。Vant 对内承载了有赞所有核心业务,对外服务十多万开发者,是业界主流的移动端组件库之一。 <br><br>
Vant 是**有赞前端团队**开源的移动端组件库,于 2017 年开源,已持续维护 4 年时间。Vant 对内承载了有赞所有核心业务,对外服务十多万开发者,是业界主流的移动端组件库之一。
目前 Vant 官方提供了 [Vue 2 版本](https://vant-contrib.gitee.io/vant)、[Vue 3 版本](https://vant-contrib.gitee.io/vant/v3)和[微信小程序版本](http://vant-contrib.gitee.io/vant-weapp),并由社区团队维护 [React 版本](https://github.com/mxdi9i7/vant-react)和[支付宝小程序版本](https://github.com/ant-move/Vant-Aliapp)。
@ -69,6 +69,7 @@ Vant 3 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一致
| [vant-aliapp](https://github.com/ant-move/Vant-Aliapp) | Vant 支付宝小程序版 |
| [taroify](https://gitee.com/mallfoundry/taroify) | Vant Taro 版 |
| [vant-theme](https://github.com/Aisen60/vant-theme) | Vant 在线主题预览工具 |
| [@antmjs/vantui](https://github.com/antmjs/vantui) | 基于 Vant Weapp 开发的多端组件库,同时支持 Taro 和 React |
### 链接

View File

@ -4,38 +4,50 @@
本文档提供了从 Vant 3 到 Vant 4 的升级指南。
## 不兼容更新
### 为什么会有 Vant 4.0
### 主题定制方式调整
为了支持 **暗色模式**,我们对 Vant 中的 **样式变量** 进行了一些不兼容更新,因此发布了新的大版本。
不再支持基于 Less 变量进行主题定制,请使用 [ConfigProvider 全局配置](#/zh-CN/config-provider) 组件进行主题配置
如果你的项目没有使用主题定制,那样式变量的调整对你没有任何影响,只需要花几分钟去适配 API 调整,即可完成升级
### CSS 变量名称简化
为了便于使用 CSS 变量,我们对部分 CSS 变量的名称进行了简化,使用更短的单词代替:
```
text-link -> link
box-shadow -> shadow
font-family -> font
border-radius -> radius
background-color -> background
font-weight-bold -> font-bold
border-width-base -> border-width
price-integer-font -> price-font
animation-duration -> duration
transition-duration -> duration
animation-timing-function-enter -> ease-out
animation-timing-function-leave -> ease-in
```
如果你的项目使用了主题定制,请完整阅读此文档,并进行迁移。
### API 调整
4.0 版本对少量 API 进行了不兼容调整:
#### Picker
- `default` 插槽重命名为 `toolbar`
- 移除了 `value-key` 属性,使用 `columnsFieldNames` 属性代替
### Tabs
#### Tabs
- 移除了 `click``disabled` 事件,使用 `click-tab` 事件代替
## 样式变量调整
### 移除 Less 变量
目前 Vant 已经支持了基于 CSS 变量的主题定制能力,因此后续将不再提供 Less 变量。
如果你的项目正在使用 Less 变量进行主题定制,请使用 [ConfigProvider 全局配置](#/zh-CN/config-provider) 组件进行替换。
### 简化 CSS 变量名
考虑到 **代码体积****使用便捷性**,我们对部分 CSS 变量的名称进行了简化,在变量名中使用更简短的单词,涉及以下变更:
```less
animation-duration -> duration
animation-timing-function-enter -> ease-out
animation-timing-function-leave -> ease-in
background-color -> background
border-radius -> radius
border-width-base -> border-width
box-shadow -> shadow
font-family -> font
font-weight-bold -> font-bold
price-integer-font -> price-font
text-link -> link
transition-duration -> duration
```

View File

@ -1,6 +1,6 @@
{
"name": "vant",
"version": "3.2.6",
"version": "3.2.7",
"description": "Mobile UI Components built on Vue",
"main": "lib/index.js",
"module": "es/index.js",

View File

@ -23,11 +23,13 @@ import { Icon } from '../icon';
const [name, bem] = createNamespace('cell');
export type CellSize = 'normal' | 'large';
export type CellArrowDirection = 'up' | 'down' | 'left' | 'right';
export const cellSharedProps = {
icon: String,
size: String as PropType<'large'>,
size: String as PropType<CellSize>,
title: numericProp,
value: numericProp,
label: numericProp,
@ -57,14 +59,6 @@ export default defineComponent({
props: cellProps,
setup(props, { slots }) {
if (process.env.NODE_ENV !== 'production') {
if (slots.default) {
console.warn(
'[Vant] Cell: "default" slot is deprecated, please use "value" slot instead.'
);
}
}
const route = useRoute();
const renderLabel = () => {
@ -94,8 +88,7 @@ export default defineComponent({
};
const renderValue = () => {
// default slot is deprecated
// should be removed in next major version
// slots.default is an alias of slots.value
const slot = slots.value || slots.default;
const hasValue = slot || isDef(props.value);

View File

@ -197,7 +197,12 @@ app.use(CellGroup);
The component exports the following type definitions:
```ts
import type { CellProps, CellGroupProps, CellArrowDirection } from 'vant';
import type {
CellSize,
CellProps,
CellGroupProps,
CellArrowDirection,
} from 'vant';
```
## Theming

View File

@ -202,7 +202,12 @@ app.use(CellGroup);
组件导出以下类型定义:
```ts
import type { CellProps, CellGroupProps, CellArrowDirection } from 'vant';
import type {
CellSize,
CellProps,
CellGroupProps,
CellArrowDirection,
} from 'vant';
```
## 主题定制

View File

@ -3,4 +3,4 @@ import _Cell from './Cell';
export const Cell = withInstall(_Cell);
export default Cell;
export type { CellProps, CellArrowDirection } from './Cell';
export type { CellSize, CellProps, CellArrowDirection } from './Cell';

View File

@ -3,3 +3,4 @@ import _Overlay from './Overlay';
export const Overlay = withInstall(_Overlay);
export default Overlay;
export type { OverlayProps } from './Overlay';

View File

@ -86,7 +86,11 @@ export default {
},
{
path: 'migrate-from-v2',
title: '从 v2 升级',
title: '从 v2 升级到 v3',
},
{
path: 'migrate-from-v3',
title: '从 v3 升级到 v4',
},
{
path: 'contribution',