Merge branch 'dev' into next

This commit is contained in:
chenjiahan
2022-07-10 21:23:47 +08:00
25 changed files with 59 additions and 294 deletions
@@ -15,7 +15,7 @@
"build": "vant-cli build",
"release": "vant-cli release",
"test:coverage": "open test/coverage/index.html",
"build-site": "vant-cli build-site && gh-pages -d site-dist"
"build-site": "vant-cli build-site && npx gh-pages -d site-dist"
},
"author": "",
"husky": {
@@ -17,7 +17,7 @@
"build": "vant-cli build",
"build:site": "vant-cli build-site",
"release": "vant-cli release --tag next",
"release:site": "pnpm build:site && gh-pages -d site-dist",
"release:site": "pnpm build:site && npx gh-pages -d site-dist",
"test:watch": "vant-cli test --watch",
"test:coverage": "open test/coverage/index.html"
},
+9 -2
View File
@@ -325,7 +325,7 @@ module.exports = {
versions: [
{
label: 'v1',
link: 'https://youzan.github.io/vant/v1/',
link: 'https://vant-ui.github.io/vant/v1/',
},
],
},
@@ -380,12 +380,19 @@ Customize iframe URL.
Customize HTML meta tag, key means name, value means content.
### site.headHtml
- Type: `string`
- Default: `undefined`
Insert a custom HTML content in the `<head>` tag.
### site.enableVConsole
- Type: `boolean`
- Default: `false`
Should use [vConsole](https://github.com/Tencent/vConsole) to debug when dev. For mobile.
Whether to enable [vConsole](https://github.com/Tencent/vConsole) debugging in dev, usually used for mobile debugging.
## PostCSS
+9 -2
View File
@@ -327,7 +327,7 @@ module.exports = {
versions: [
{
label: 'v1',
link: 'https://youzan.github.io/vant/v1/',
link: 'https://vant-ui.github.io/vant/v1/',
},
],
},
@@ -337,7 +337,7 @@ module.exports = {
### site.baiduAnalytics
- Type: `object`
- Default: `undefied`
- Default: `undefined`
文档网站的百度统计配置,添加这项配置后,会自动在构建文档网站时加载百度统计的脚本。
@@ -384,6 +384,13 @@ module.exports = {
配置 HTML 中的 meta 标签,对象的 key 为 namevalue 为 content。
### site.headHtml
- Type: `string`
- Default: `undefined`
`<head>` 标签中插入一段自定义的 HTML 内容。
### site.enableVConsole
- Type: `boolean`
-1
View File
@@ -69,7 +69,6 @@
"execa": "^5.1.1",
"fast-glob": "^3.2.7",
"fs-extra": "^10.0.0",
"gh-pages": "^3.2.3",
"hash-sum": "^2.0.0",
"highlight.js": "^11.3.1",
"husky": "^8.0.1",
@@ -1,5 +1,4 @@
@import './vars.less';
@import './font.less';
body {
min-width: 1100px;
@@ -1,163 +0,0 @@
/* cyrillic-ext */
@font-face {
font-weight: 400;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans Regular'), local('OpenSans-Regular'),
url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFWJ0bf8pkAp6a.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-weight: 400;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans Regular'), local('OpenSans-Regular'),
url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFUZ0bf8pkAp6a.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-weight: 400;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans Regular'), local('OpenSans-Regular'),
url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFWZ0bf8pkAp6a.woff2)
format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-weight: 400;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans Regular'), local('OpenSans-Regular'),
url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFVp0bf8pkAp6a.woff2)
format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-weight: 400;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans Regular'), local('OpenSans-Regular'),
url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFWp0bf8pkAp6a.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-weight: 400;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans Regular'), local('OpenSans-Regular'),
url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFW50bf8pkAp6a.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-weight: 400;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans Regular'), local('OpenSans-Regular'),
url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFVZ0bf8pkAg.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-weight: 600;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'),
url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOX-hpKKSTj5PW.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-weight: 600;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'),
url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOVuhpKKSTj5PW.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-weight: 600;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'),
url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOXuhpKKSTj5PW.woff2)
format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-weight: 600;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'),
url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOUehpKKSTj5PW.woff2)
format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-weight: 600;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'),
url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOXehpKKSTj5PW.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-weight: 600;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'),
url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOXOhpKKSTj5PW.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-weight: 600;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'),
url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
U+FEFF, U+FFFD;
}
+3
View File
@@ -15,6 +15,9 @@
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<% if (headHtml) { %>
<%- headHtml %>
<% } %>
<% if (baiduAnalytics) { %>
<script>
var _hmt = _hmt || [];
+3
View File
@@ -15,6 +15,9 @@
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<% if (headHtml) { %>
<%- headHtml %>
<% } %>
<% if (enableVConsole) { %>
<script src="https://unpkg.com/vconsole/dist/vconsole.min.js"></script>
<script>
@@ -137,6 +137,7 @@ export function getViteConfigForSiteDev(): InlineConfig {
const vantConfig = getVantConfig();
const siteConfig = getSiteConfig(vantConfig);
const title = getTitle(siteConfig);
const headHtml = vantConfig.site?.headHtml;
const baiduAnalytics = vantConfig.site?.baiduAnalytics;
const enableVConsole = isDev() && vantConfig.site?.enableVConsole;
@@ -178,6 +179,7 @@ export function getViteConfigForSiteDev(): InlineConfig {
// `description` is used by the HTML ejs template,
// so it needs to be written explicitly here to avoid error: description is not defined
description: siteConfig.description,
headHtml,
baiduAnalytics,
enableVConsole,
meta: getHTMLMeta(vantConfig),
+2 -2
View File
@@ -15,5 +15,5 @@ pnpm add @vant/icons
## Document
- [Usage in Vue](https://youzan.github.io/vant/#/zh-CN/icon)
- [Usage in Weapp](https://youzan.github.io/vant-weapp/#/icon)
- [Usage in Vue](https://vant-ui.github.io/vant/#/zh-CN/icon)
- [Usage in Weapp](https://vant-ui.github.io/vant-weapp/#/icon)
+2 -1
View File
@@ -29,6 +29,7 @@
"fs-extra": "^10.0.0"
},
"devDependencies": {
"@types/fs-extra": "^9.0.13"
"@types/fs-extra": "^9.0.13",
"typescript": "^4.7.4"
}
}
@@ -4,8 +4,8 @@
The current document is the changelog of Vant 4, other versions:
- [Vant 2 Changelog](https://youzan.github.io/vant/v2/#/en-US/changelog)
- [Vant 3 Changelog](https://youzan.github.io/vant/v3/#/en-US/changelog)
- [Vant 2 Changelog](https://vant-ui.github.io/vant/v2/#/en-US/changelog)
- [Vant 3 Changelog](https://vant-ui.github.io/vant/v3/#/en-US/changelog)
### Intro
@@ -4,8 +4,8 @@
当前文档为 Vant 4 的更新日志,其他版本请参考:
- [Vant 2 更新日志](https://youzan.github.io/vant/v2/#/zh-CN/changelog)
- [Vant 3 更新日志](https://youzan.github.io/vant/v3/#/zh-CN/changelog)
- [Vant 2 更新日志](https://vant-ui.github.io/vant/v2/#/zh-CN/changelog)
- [Vant 3 更新日志](https://vant-ui.github.io/vant/v3/#/zh-CN/changelog)
### 介绍
+1 -1
View File
@@ -23,7 +23,7 @@
"build": "vant-cli build",
"build:site": "vant-cli build-site",
"release": "cp ../../README.md ./ && vant-cli release && rm ./README.md",
"release:site": "pnpm build:site && gh-pages -d site-dist --add",
"release:site": "pnpm build:site && npx gh-pages -d site-dist --add",
"test:watch": "vant-cli test --watch",
"test:coverage": "open test/coverage/index.html"
},
+3
View File
@@ -214,6 +214,8 @@ export default defineComponent({
return !currentDate.value;
});
const getSelectedDate = () => currentDate.value;
// calculate the position of the elements
// and find the elements that needs to be rendered
const onScroll = () => {
@@ -552,6 +554,7 @@ export default defineComponent({
useExpose<CalendarExpose>({
reset,
scrollToDate,
getSelectedDate,
});
onMountedOrActivated(init);
+1
View File
@@ -348,6 +348,7 @@ Use [ref](https://v3.vuejs.org/guide/component-template-refs.html) to get Calend
| --- | --- | --- | --- |
| reset | Reset selected date, will reset to default date when no params passed | _date?: Date \| Date[]_ | - |
| scrollToDate | Scroll to date | _date: Date_ | - |
| getSelectedDate | get selected date | - | _Date \| Date[] \| null_ |
### Types
@@ -354,6 +354,7 @@ export default {
| --- | --- | --- | --- |
| reset | 将选中的日期重置到指定日期,未传参时会重置到默认日期 | _date?: Date \| Date[]_ | - |
| scrollToDate | 滚动到某个日期 | _date: Date_ | - |
| getSelectedDate | 获取选中的日期 | - | _Date \| Date[] \| null_ |
### 类型定义
+1
View File
@@ -29,6 +29,7 @@ export type CalendarDayItem = {
export type CalendarExpose = {
reset: (date?: Date | Date[]) => void;
scrollToDate: (targetDate: Date) => void;
getSelectedDate: () => Date | Date[] | null;
};
export type CalendarInstance = ComponentPublicInstance<
+1 -1
View File
@@ -230,7 +230,7 @@ export default defineComponent({
const imageFiles = props.modelValue.filter(isImageFile);
const images = imageFiles
.map((item) => {
if (item.file && !item.url) {
if (item.file && !item.url && item.status !== 'failed') {
item.url = URL.createObjectURL(item.file);
urls.push(item.url);
}
+6
View File
@@ -34,6 +34,12 @@ export default {
htmlMeta: {
'docsearch:version': 'v4',
},
headHtml: `<script>
if (location.host === 'youzan.github.io') {
location.href = location.href.replace('youzan.github.io', 'vant-ui.github.io');
}
</script>
`,
locales: {
'zh-CN': {
title: 'Vant 4',