Merge branch 'dev' into next

This commit is contained in:
chenjiahan
2022-09-10 21:51:26 +08:00
17 changed files with 74 additions and 49 deletions
+6
View File
@@ -31,6 +31,12 @@ yarn add stylelint@13 @vant/stylelint-config
现在会默认生成 WebStorm 所需的 web-types.json 文件到 `lib/web-types.json` 目录下。
## v4.0.4
`2022-07-02`
- 修复构建 sfc 文件的类型定义时报错的问题
## v4.0.3
`2022-07-02`
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@vant/cli",
"version": "4.0.3",
"version": "4.0.4",
"type": "module",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
@@ -87,11 +87,6 @@ export async function compileSfc(filePath: string): Promise<any> {
new Promise((resolve) => {
let script = '';
// the generated render fn lacks type definitions
if (lang === 'ts') {
script += '// @ts-nocheck\n';
}
let bindingMetadata;
if (descriptor.scriptSetup) {
const { bindings, content } = compileScript(descriptor, {
@@ -125,6 +120,12 @@ export async function compileSfc(filePath: string): Promise<any> {
script += `\n${EXPORT} ${VUEIDS}`;
// ts-nocheck should be placed on the first line
// the generated render fn lacks type definitions
if (lang === 'ts') {
script = '// @ts-nocheck\n' + script;
}
outputFile(scriptFilePath, script).then(resolve);
})
);
@@ -4,7 +4,7 @@
感谢你使用 Vant。
以下是关于向 Vant 提交反馈或代码的指南。在向 Vant 提交 issue 或者 PR 之前,请先花几分钟时间阅读以下文字
以下是关于向 Vant 提交反馈或代码的指南。在向 Vant 提交 issue 或者 PR 之前,请先花几分钟时间阅读以下内容
### Issue 规范
@@ -15,7 +15,7 @@
### 本地开发
在进行本地开发前,请先确保你的开发环境中安装了 [Node.js >= 14](https://nodejs.org) 和 [pnpm](https://pnpm.io).
在进行本地开发前,请先确保你的开发环境中安装了 [Node.js >= 14.19.0](https://nodejs.org)
按照下面的步骤操作,即可在本地开发 Vant 组件。
@@ -23,6 +23,12 @@
# 克隆仓库
git clone git@github.com:vant-ui/vant.git
# 启用 pnpm 包管理器
corepack enable
# 如果无法使用 corepack,你也可以手动安装 pnpm
npm install -g pnpm@7
# 安装依赖
pnpm i
+1
View File
@@ -56,6 +56,7 @@
},
"devDependencies": {
"@types/node": "^16.11.56",
"@types/jest": "^27.0.0",
"@vant/area-data": "workspace:*",
"@vant/cli": "workspace:*",
"@vant/eslint-config": "workspace:*",
+1 -1
View File
@@ -176,7 +176,7 @@ Vant exports following Dialog utility functions:
| title | Title | _string_ | - |
| width | Width | _number \| string_ | `320px` |
| message | Message | _string \| () => JSX.ELement_ | - |
| message-align | Message align, can be set to `left` `right` | _string_ | `center` |
| message-align | Message align, can be set to `left` `right` `justify` | _string_ | `center` |
| theme | Theme style, can be set to `round-button` | _string_ | `default` |
| show-confirm-button | Whether to show confirm button | _boolean_ | `true` |
| show-cancel-button | Whether to show cancel button | _boolean_ | `false` |
+1 -1
View File
@@ -197,7 +197,7 @@ Vant 中导出了以下 Dialog 相关的辅助函数:
| title | 标题 | _string_ | - |
| width | 弹窗宽度,默认单位为 `px` | _number \| string_ | `320px` |
| message | 文本内容,支持通过 `\n` 换行 | _string \| () => JSX.Element_ | - |
| message-align | 内容水平对齐方式,可选值为 `left` `right` | _string_ | `center` |
| message-align | 内容水平对齐方式,可选值为 `left` `right` `justify` | _string_ | `center` |
| theme | 样式风格,可选值为 `round-button` | _string_ | `default` |
| show-confirm-button | 是否展示确认按钮 | _boolean_ | `true` |
| show-cancel-button | 是否展示取消按钮 | _boolean_ | `false` |
+4
View File
@@ -82,6 +82,10 @@ body {
&--right {
text-align: right;
}
&--justify {
text-align: justify;
}
}
&__footer {
+1 -1
View File
@@ -4,7 +4,7 @@ import type { Interceptor, Numeric } from '../utils';
export type DialogTheme = 'default' | 'round-button';
export type DialogAction = 'confirm' | 'cancel';
export type DialogMessage = string | (() => JSX.Element);
export type DialogMessageAlign = 'left' | 'center' | 'right';
export type DialogMessageAlign = 'left' | 'center' | 'right' | 'justify';
export type DialogOptions = {
title?: string;
+5 -1
View File
@@ -44,6 +44,7 @@ export const imageProps = {
fit: String as PropType<ImageFit>,
position: String as PropType<ImagePosition>,
round: Boolean,
block: Boolean,
width: numericProp,
height: numericProp,
radius: numericProp,
@@ -191,7 +192,10 @@ export default defineComponent({
}
return () => (
<div class={bem({ round: props.round })} style={style.value}>
<div
class={bem({ round: props.round, block: props.block })}
style={style.value}
>
{renderImage()}
{renderPlaceholder()}
{slots.default?.()}
+1
View File
@@ -101,6 +101,7 @@ app.use(Lazyload);
| height | Height | _number \| string_ | - |
| radius | Border Radius | _number \| string_ | `0` |
| round | Whether to be round | _boolean_ | `false` |
| block `3.6.3` | Whether the root node is a block element | _boolean_ | `false` |
| lazy-load | Whether to enable lazy load, should register [Lazyload](#/en-US/lazyload) component | _boolean_ | `false` |
| show-error | Whether to show error placeholder | _boolean_ | `true` |
| show-loading | Whether to show loading placeholder | _boolean_ | `true` |
+1
View File
@@ -127,6 +127,7 @@ app.use(Lazyload);
| height | 高度,默认单位为 `px` | _number \| string_ | - |
| radius | 圆角大小,默认单位为 `px` | _number \| string_ | `0` |
| round | 是否显示为圆形 | _boolean_ | `false` |
| block `3.6.3` | 是否将根节点设置为块级元素,默认情况下为 `inline-block` 元素 | _boolean_ | `false` |
| lazy-load | 是否开启图片懒加载,须配合 [Lazyload](#/zh-CN/lazyload) 组件使用 | _boolean_ | `false` |
| show-error | 是否展示图片加载失败提示 | _boolean_ | `true` |
| show-loading | 是否展示图片加载中提示 | _boolean_ | `true` |
+4
View File
@@ -21,6 +21,10 @@ body {
}
}
&--block {
display: block;
}
&__img,
&__error,
&__loading {
+2 -1
View File
@@ -1,3 +1,4 @@
import { isObject } from './validate';
import type { ComponentPublicInstance } from 'vue';
export function noop() {}
@@ -16,7 +17,7 @@ export function get(object: any, path: string): any {
let result = object;
keys.forEach((key) => {
result = result[key] ?? '';
result = isObject(result) ? result[key] ?? '' : '';
});
return result;