mirror of
https://github.com/youzan/vant.git
synced 2025-10-17 08:37:23 +00:00
Merge branch 'dev' into next
This commit is contained in:
@@ -45,8 +45,8 @@ yarn add @vant/cli --dev
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{ts,tsx,js,jsx,vue}": ["eslint", "git add"],
|
||||
"*.{vue,css,less,scss}": ["stylelint", "git add"]
|
||||
"*.{js,jsx,ts,tsx,vue}": "eslint --fix",
|
||||
"*.{vue,css,less,scss}": "stylelint --fix"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
@@ -73,7 +73,7 @@ yarn add @vant/cli --dev
|
||||
|
||||
扫码加入 Vant Cli 交流群,若群二维码过期,可以联系有赞前端小秘书加群
|
||||
|
||||
<img src="https://img.yzcdn.cn/vant/wechat_20200413.jpg" width="220" height="285" >
|
||||
<img src="https://img.yzcdn.cn/vant/wechat_20200527.jpeg" width="220" height="285" >
|
||||
|
||||
## 关于桌面端组件
|
||||
|
||||
|
@@ -1,19 +1,45 @@
|
||||
# 更新日志
|
||||
|
||||
### [v2.4.0]
|
||||
### v2.5.1
|
||||
|
||||
`2020-05-27`
|
||||
|
||||
- 移除多余的 log
|
||||
|
||||
### v2.5.0
|
||||
|
||||
`2020-05-27`
|
||||
|
||||
- 开启 fork-ts-checker-webpack-plugin,在编译时进行类型检查
|
||||
- 现在点击锚点时会立即滚动到对应位置
|
||||
|
||||
### v2.4.2
|
||||
|
||||
`2020-05-04`
|
||||
|
||||
- 升级 less-loader@6
|
||||
- 优化移动端示例导航栏样式
|
||||
|
||||
### v2.4.1
|
||||
|
||||
`2020-04-19`
|
||||
|
||||
- 支持 style 类型的 commit message
|
||||
|
||||
### v2.4.0
|
||||
|
||||
`2020-04-02`
|
||||
|
||||
- 升级 prettier v2
|
||||
- 升级 html-webpack-plugin v4
|
||||
|
||||
### [v2.3.1]
|
||||
### v2.3.1
|
||||
|
||||
`2020-03-29`
|
||||
|
||||
- 优化网站导航栏在大屏上的适配 ([#5928](https://github.com/youzan/vant/pull/5928))
|
||||
|
||||
### [v2.3.0]
|
||||
### v2.3.0
|
||||
|
||||
`2020-03-25`
|
||||
|
||||
@@ -22,26 +48,26 @@
|
||||
- clean 命令现在会移除而不是清空文件夹 ([#5895](https://github.com/youzan/vant/issues/5895))
|
||||
- 升级 @vant/markdown-vetur 2.0.0
|
||||
|
||||
### [v2.2.8]
|
||||
### v2.2.8
|
||||
|
||||
`2020-03-20`
|
||||
|
||||
- 修复构建 changelog 可能失败的问题
|
||||
|
||||
### [v2.2.7]
|
||||
### v2.2.7
|
||||
|
||||
`2020-03-19`
|
||||
|
||||
- 新增 process.env.VANT_CLI_VERSION 环境变量
|
||||
|
||||
### [v2.2.6]
|
||||
### v2.2.6
|
||||
|
||||
`2020-03-18`
|
||||
|
||||
- 升级 commander 5
|
||||
- 修复右侧预览 iframe 链接可能错误的问题
|
||||
|
||||
### [v2.2.5]
|
||||
### v2.2.5
|
||||
|
||||
`2020-03-08`
|
||||
|
||||
@@ -49,38 +75,38 @@
|
||||
- 优化代码块与底部文字之间的间距
|
||||
- 修复 create-vant-cli-app 初始化时报错的问题
|
||||
|
||||
### [v2.2.4]
|
||||
### v2.2.4
|
||||
|
||||
`2020-02-14`
|
||||
|
||||
- 修复在 windows 上构建出的样式入口文件路径错误的问题 ([#5655](https://github.com/youzan/vant/pull/5655)
|
||||
|
||||
### [v2.2.3]
|
||||
### v2.2.3
|
||||
|
||||
`2020-02-13`
|
||||
|
||||
- 链接颜色调整为蓝色
|
||||
|
||||
### [v2.2.2]
|
||||
### v2.2.2
|
||||
|
||||
`2020-02-05`
|
||||
|
||||
- 修复在 windows 上获取 markdown 路径错误的问题 ([#5626](https://github.com/youzan/vant/pull/5626))
|
||||
|
||||
### [v2.2.1]
|
||||
### v2.2.1
|
||||
|
||||
`2020-02-04`
|
||||
|
||||
- 升级 babel@7.8
|
||||
- 修复切换版本时跳转 undefined 的问题 ([#5620](https://github.com/youzan/vant/pull/5620))
|
||||
|
||||
### [v2.2.0]
|
||||
### v2.2.0
|
||||
|
||||
`2020-01-19`
|
||||
|
||||
- 升级 @vant/eslint-config@2.0.0
|
||||
|
||||
### [v2.1.8]
|
||||
### v2.1.8
|
||||
|
||||
`2020-01-18`
|
||||
|
||||
@@ -89,14 +115,14 @@
|
||||
- 优化站点导航栏颜色
|
||||
- 优化站点代码块颜色
|
||||
|
||||
### [v2.1.7]
|
||||
### v2.1.7
|
||||
|
||||
`2020-01-15`
|
||||
|
||||
- 优化 help 命令
|
||||
- 优化控制台输出信息
|
||||
|
||||
### [v2.1.6]
|
||||
### v2.1.6
|
||||
|
||||
`2020-01-12`
|
||||
|
||||
@@ -105,14 +131,14 @@
|
||||
- 优化文档站点的 meta 字段
|
||||
- 新增 API 文档中的版本标签样式
|
||||
|
||||
### [v2.1.5]
|
||||
### v2.1.5
|
||||
|
||||
`2020-01-10`
|
||||
|
||||
- 修复编译时未替换 import 语句中的 CSS 后缀的问题
|
||||
- 升级 husky 版本到 4.0
|
||||
|
||||
### [v2.1.4]
|
||||
### v2.1.4
|
||||
|
||||
`2020-01-06`
|
||||
|
||||
@@ -120,7 +146,7 @@
|
||||
|
||||
- 锁死 @vue/test-utils 版本为 1.0.0-beta.29
|
||||
|
||||
### [v2.1.3]
|
||||
### v2.1.3
|
||||
|
||||
`2020-01-06`
|
||||
|
||||
@@ -129,7 +155,7 @@
|
||||
- 增加 cache-loader,提高构建速度
|
||||
- 调整 jest setup 文件执行时机,延迟至 env 初始化后执行
|
||||
|
||||
### [v2.1.2]
|
||||
### v2.1.2
|
||||
|
||||
`2020-01-05`
|
||||
|
||||
|
@@ -30,8 +30,8 @@ module.exports = {
|
||||
// 构建配置
|
||||
build: {
|
||||
site: {
|
||||
publicPath: '/demo-ui/'
|
||||
}
|
||||
publicPath: '/demo-ui/',
|
||||
},
|
||||
},
|
||||
// 文档站点配置
|
||||
site: {
|
||||
@@ -48,21 +48,21 @@ module.exports = {
|
||||
items: [
|
||||
{
|
||||
path: 'home',
|
||||
title: '介绍'
|
||||
}
|
||||
]
|
||||
title: '介绍',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '基础组件',
|
||||
items: [
|
||||
{
|
||||
path: 'my-button',
|
||||
title: 'MyButton 按钮'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
title: 'MyButton 按钮',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
@@ -84,9 +84,9 @@ CSS 预处理器配置,目前支持`less`和`sass`两种预处理器,默认
|
||||
module.exports = {
|
||||
build: {
|
||||
css: {
|
||||
preprocessor: 'sass'
|
||||
}
|
||||
}
|
||||
preprocessor: 'sass',
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
@@ -103,9 +103,22 @@ module.exports = {
|
||||
module.exports = {
|
||||
build: {
|
||||
site: {
|
||||
publicPath: '/demo-ui/'
|
||||
}
|
||||
}
|
||||
publicPath: '/demo-ui/',
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### build.srcDir
|
||||
|
||||
- Type: `string`
|
||||
- Default: `src`
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
build: {
|
||||
srcDir: 'myDir',
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
@@ -150,12 +163,12 @@ module.exports = {
|
||||
// 导航项路由
|
||||
path: 'home',
|
||||
// 导航项文案
|
||||
title: '介绍'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
title: '介绍',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
@@ -172,10 +185,10 @@ module.exports = {
|
||||
versions: [
|
||||
{
|
||||
label: '1.x',
|
||||
link: 'https://youzan.github.io/vant/1.x/'
|
||||
}
|
||||
]
|
||||
}
|
||||
link: 'https://youzan.github.io/vant/1.x/',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
@@ -193,9 +206,9 @@ module.exports = {
|
||||
// 打开百度统计 ->『管理』->『代码获取』
|
||||
// 找到下面这串 URL: "https://hm.baidu.com/hm.js?xxxxx"
|
||||
// 将 `xxxxx` 填写在 seed 中即可
|
||||
seed: 'xxxxx'
|
||||
}
|
||||
}
|
||||
seed: 'xxxxx',
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
@@ -208,8 +221,8 @@ module.exports = {
|
||||
```js
|
||||
module.exports = {
|
||||
devServer: {
|
||||
port: 9000
|
||||
}
|
||||
port: 9000,
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
@@ -223,7 +236,7 @@ module.exports = {
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
presets: ['@vant/cli/preset']
|
||||
presets: ['@vant/cli/preset'],
|
||||
};
|
||||
```
|
||||
|
||||
@@ -270,8 +283,8 @@ module.exports = {
|
||||
```js
|
||||
module.exports = {
|
||||
plugins: {
|
||||
autoprefixer: {}
|
||||
}
|
||||
autoprefixer: {},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vant/cli",
|
||||
"version": "2.4.0",
|
||||
"version": "2.5.1",
|
||||
"description": "",
|
||||
"main": "lib/index.js",
|
||||
"typings": "lib/index.d.ts",
|
||||
@@ -34,22 +34,22 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "^8.1.0",
|
||||
"@types/lodash": "^4.14.149",
|
||||
"@types/lodash": "^4.14.150",
|
||||
"@types/postcss-load-config": "^2.0.1",
|
||||
"@types/webpack": "^4.41.10",
|
||||
"@types/webpack": "^4.41.12",
|
||||
"@types/webpack-dev-server": "^3.10.1",
|
||||
"@types/webpack-merge": "^4.1.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.9.0",
|
||||
"@babel/core": "^7.9.6",
|
||||
"@babel/plugin-syntax-jsx": "^7.8.3",
|
||||
"@babel/plugin-transform-object-assign": "^7.8.3",
|
||||
"@babel/plugin-transform-runtime": "^7.9.0",
|
||||
"@babel/preset-env": "^7.9.5",
|
||||
"@babel/plugin-transform-runtime": "^7.9.6",
|
||||
"@babel/preset-env": "^7.9.6",
|
||||
"@babel/preset-typescript": "^7.9.0",
|
||||
"@nuxt/friendly-errors-webpack-plugin": "^2.5.0",
|
||||
"@types/jest": "^25.2.1",
|
||||
"@vant/eslint-config": "^2.0.0",
|
||||
"@vant/eslint-config": "^2.2.2",
|
||||
"@vant/markdown-loader": "^2.3.0",
|
||||
"@vant/markdown-vetur": "^2.0.1",
|
||||
"@vant/stylelint-config": "^1.3.0",
|
||||
@@ -59,47 +59,48 @@
|
||||
"@vue/test-utils": "1.0.0-beta.29",
|
||||
"address": "^1.1.2",
|
||||
"autoprefixer": "^9.7.6",
|
||||
"babel-jest": "^25.3.0",
|
||||
"babel-jest": "^25.5.1",
|
||||
"babel-loader": "^8.1.0",
|
||||
"babel-plugin-import": "^1.13.0",
|
||||
"babel-plugin-transform-jsx-vue3": "^0.1.8",
|
||||
"cache-loader": "^4.1.0",
|
||||
"chokidar": "^3.3.1",
|
||||
"chokidar": "^3.4.0",
|
||||
"clean-css": "^4.2.3",
|
||||
"codecov": "^3.6.5",
|
||||
"commander": "^5.0.0",
|
||||
"commander": "^5.1.0",
|
||||
"consola": "^2.11.3",
|
||||
"conventional-changelog": "^3.1.18",
|
||||
"cross-env": "^7.0.2",
|
||||
"css-loader": "^3.5.2",
|
||||
"css-loader": "^3.5.3",
|
||||
"eslint": "^6.8.0",
|
||||
"fast-glob": "^3.2.2",
|
||||
"fork-ts-checker-webpack-plugin": "^4.1.6",
|
||||
"gh-pages": "^2.2.0",
|
||||
"hash-sum": "^2.0.0",
|
||||
"html-webpack-plugin": "4.2.0",
|
||||
"html-webpack-plugin": "4.3.0",
|
||||
"husky": "^4.2.5",
|
||||
"jest": "^25.3.0",
|
||||
"jest": "^25.5.4",
|
||||
"jest-canvas-mock": "^2.2.0",
|
||||
"jest-serializer-vue": "^2.0.2",
|
||||
"less": "^3.11.1",
|
||||
"less-loader": "^5.0.0",
|
||||
"lint-staged": "^10.1.3",
|
||||
"less-loader": "^6.0.0",
|
||||
"lint-staged": "^10.2.2",
|
||||
"lodash": "^4.17.15",
|
||||
"ora": "^4.0.3",
|
||||
"portfinder": "^1.0.25",
|
||||
"postcss": "^7.0.27",
|
||||
"ora": "^4.0.4",
|
||||
"portfinder": "^1.0.26",
|
||||
"postcss": "^7.0.28",
|
||||
"postcss-loader": "^3.0.0",
|
||||
"prettier": "^2.0.4",
|
||||
"release-it": "^13.5.2",
|
||||
"sass": "^1.26.3",
|
||||
"prettier": "^2.0.5",
|
||||
"release-it": "^13.5.7",
|
||||
"sass": "^1.26.5",
|
||||
"sass-loader": "^8.0.2",
|
||||
"style-loader": "^1.1.3",
|
||||
"stylelint": "^13.3.1",
|
||||
"style-loader": "^1.2.1",
|
||||
"stylelint": "^13.3.3",
|
||||
"typescript": "^3.8.3",
|
||||
"vue-jest": "4.0.0-beta.2",
|
||||
"vue-loader": "^16.0.0-alpha.3",
|
||||
"vue-router": "^4.0.0-alpha.7 ",
|
||||
"webpack": "^4.42.1",
|
||||
"vue-router": "^4.0.0-alpha.12",
|
||||
"webpack": "^4.43.0",
|
||||
"webpack-dev-server": "3.10.3",
|
||||
"webpack-merge": "^4.2.2",
|
||||
"webpackbar": "^4.0.0"
|
||||
|
@@ -6,7 +6,9 @@ body {
|
||||
overflow-x: auto;
|
||||
color: @van-doc-black;
|
||||
font-size: 16px;
|
||||
font-family: PingFang SC, 'Helvetica Neue', Arial, sans-serif;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica,
|
||||
Segoe UI, Arial, Roboto, 'PingFang SC', 'Hiragino Sans GB',
|
||||
'Microsoft Yahei', sans-serif;
|
||||
background-color: @van-doc-background-color;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
@@ -4,9 +4,7 @@ export function scrollToAnchor(selector) {
|
||||
const timer = setInterval(() => {
|
||||
const el = document.querySelector(selector);
|
||||
if (el) {
|
||||
el.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
});
|
||||
el.scrollIntoView();
|
||||
clearInterval(timer);
|
||||
} else {
|
||||
count++;
|
||||
|
@@ -39,9 +39,10 @@ export default {
|
||||
<style lang="less">
|
||||
.demo-nav {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 56px;
|
||||
line-height: 56px;
|
||||
text-align: center;
|
||||
background-color: #fff;
|
||||
|
||||
&__title {
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { readFileSync } from 'fs-extra';
|
||||
import { consola } from '../common/logger';
|
||||
|
||||
const commitRE = /^(revert: )?(fix|feat|docs|perf|test|types|build|chore|refactor|breaking change)(\(.+\))?: .{1,50}/;
|
||||
const mergeRE = /Merge branch /;
|
||||
const commitRE = /^(revert: )?(fix|feat|docs|perf|test|types|style|build|chore|refactor|breaking change)(\(.+\))?: .{1,50}/;
|
||||
const mergeRE = /Merge /;
|
||||
|
||||
export function commitLint() {
|
||||
const gitParams = process.env.HUSKY_GIT_PARAMS as string;
|
||||
|
@@ -1,7 +1,11 @@
|
||||
import sass from 'sass';
|
||||
import FriendlyErrorsPlugin from '@nuxt/friendly-errors-webpack-plugin';
|
||||
import { VueLoaderPlugin } from 'vue-loader';
|
||||
import { join } from 'path';
|
||||
import { existsSync } from 'fs';
|
||||
import { consola } from '../common/logger';
|
||||
import {
|
||||
CWD,
|
||||
CACHE_DIR,
|
||||
STYLE_EXTS,
|
||||
SCRIPT_EXTS,
|
||||
@@ -28,6 +32,35 @@ const CSS_LOADERS = [
|
||||
},
|
||||
];
|
||||
|
||||
const plugins = [
|
||||
new VueLoaderPlugin(),
|
||||
new FriendlyErrorsPlugin({
|
||||
clearConsole: false,
|
||||
logLevel: 'WARNING',
|
||||
}),
|
||||
];
|
||||
|
||||
const tsconfigPath = join(CWD, 'tsconfig.json');
|
||||
if (existsSync(tsconfigPath)) {
|
||||
const ForkTsCheckerPlugin = require('fork-ts-checker-webpack-plugin');
|
||||
plugins.push(
|
||||
new ForkTsCheckerPlugin({
|
||||
formatter: 'codeframe',
|
||||
vue: { enabled: true },
|
||||
logger: {
|
||||
// skip info message
|
||||
info() {},
|
||||
warn(message: string) {
|
||||
consola.warn(message);
|
||||
},
|
||||
error(message: string) {
|
||||
consola.error(message);
|
||||
},
|
||||
},
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
export const baseConfig = {
|
||||
mode: 'development',
|
||||
resolve: {
|
||||
@@ -83,11 +116,5 @@ export const baseConfig = {
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new VueLoaderPlugin(),
|
||||
new FriendlyErrorsPlugin({
|
||||
clearConsole: false,
|
||||
logLevel: 'WARNING',
|
||||
}),
|
||||
],
|
||||
plugins,
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user