Merge branch 'dev' into feature/vant_cli_2

This commit is contained in:
陈嘉涵 2019-12-11 11:31:57 +08:00
commit a78fc55079
22 changed files with 372 additions and 315 deletions

View File

@ -1,5 +1,16 @@
# Changelog # Changelog
### [v2.3.0-beta.3](https://github.com/youzan/vant/tree/v2.3.0-beta.3)
`2019-12-09`
**Bug Fixes**
- fix Sku should check state when reset [\#5231](https://github.com/youzan/vant/pull/5231)
- fix Switch incorrect size prop type [\#5229](https://github.com/youzan/vant/pull/5229)
- fix SubmitBar incorrect decimal when price is integer [\#5224](https://github.com/youzan/vant/pull/5224)
- fix AddressList incorrect tel when isDefault is 0 [\#5232](https://github.com/youzan/vant/pull/5232)
### [v2.3.0-beta.2](https://github.com/youzan/vant/tree/v2.3.0-beta.2) ### [v2.3.0-beta.2](https://github.com/youzan/vant/tree/v2.3.0-beta.2)
`2019-12-06` `2019-12-06`

View File

@ -11,6 +11,17 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。
- 主版本号:发布时间不定,包含不兼容更新,预计下一个主版本会与 Vue 3.0 同期发布。 - 主版本号:发布时间不定,包含不兼容更新,预计下一个主版本会与 Vue 3.0 同期发布。
### [v2.3.0-beta.3](https://github.com/youzan/vant/tree/v2.3.0-beta.3)
`2019-12-09`
**Bug Fixes**
- 修复 Sku 重置时未校验数量的问题 [\#5231](https://github.com/youzan/vant/pull/5231)
- 修复 Switch size 属性未定义 Number 类型的问题 [\#5229](https://github.com/youzan/vant/pull/5229)
- 修复 SubmitBar 价格为整数时显示错误的问题 [\#5224](https://github.com/youzan/vant/pull/5224)
- 修复 AddressList isDefault 设置为 0 时显示错误的问题 [\#5232](https://github.com/youzan/vant/pull/5232)
### [v2.3.0-beta.2](https://github.com/youzan/vant/tree/v2.3.0-beta.2) ### [v2.3.0-beta.2](https://github.com/youzan/vant/tree/v2.3.0-beta.2)
`2019-12-06` `2019-12-06`

View File

@ -1,6 +1,6 @@
{ {
"name": "vant", "name": "vant",
"version": "2.3.0-beta.2", "version": "2.3.0-beta.3",
"description": "Mobile UI Components built on Vue", "description": "Mobile UI Components built on Vue",
"main": "lib/index.js", "main": "lib/index.js",
"module": "es/index.js", "module": "es/index.js",
@ -52,7 +52,7 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@babel/runtime": "7.x", "@babel/runtime": "7.x",
"@vant/icons": "1.1.15", "@vant/icons": "1.2.0",
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0", "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
"vue-lazyload": "1.2.3" "vue-lazyload": "1.2.3"
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "@vant/icons", "name": "@vant/icons",
"version": "1.1.15", "version": "1.2.0",
"description": "vant icons", "description": "vant icons",
"main": "./src/config.js", "main": "./src/config.js",
"files": [ "files": [
@ -12,18 +12,26 @@
"scripts": { "scripts": {
"export": "node ./build/export.js", "export": "node ./build/export.js",
"build": "npm run export && gulp --gulpfile ./build/build-iconfont.js", "build": "npm run export && gulp --gulpfile ./build/build-iconfont.js",
"release": "npm run build && npm publish" "release": "npm run build && release-it"
}, },
"license": "MIT", "license": "MIT",
"repository": "https://github.com/youzan/vant/tree/dev/packages/vant-icons", "repository": "https://github.com/youzan/vant/tree/dev/packages/vant-icons",
"devDependencies": { "devDependencies": {
"fast-glob": "^3.0.0", "fast-glob": "^3.1.1",
"fs-extra": "^8.0.1", "fs-extra": "^8.1.0",
"gulp": "^4.0.2", "gulp": "^4.0.2",
"gulp-iconfont": "^10.0.3", "gulp-iconfont": "^10.0.3",
"gulp-iconfont-css": "^3.0.0", "gulp-iconfont-css": "^3.0.0",
"md5-file": "^4.0.0", "md5-file": "^4.0.0",
"shelljs": "^0.8.3", "shelljs": "^0.8.3",
"svgo": "^1.2.2" "svgo": "1.2.2"
},
"release-it": {
"git": {
"tag": false,
"commitMessage": "chore: release @vant/icons ${version}",
"addUntrackedFiles": true,
"requireCleanWorkingDir": false
}
} }
} }

View File

@ -65,7 +65,7 @@ module.exports = {
'photo-o', 'photo-o',
'gift-card-o', 'gift-card-o',
'expand-o', 'expand-o',
'medel-o', 'medal-o',
'good-job-o', 'good-job-o',
'manager-o', 'manager-o',
'label-o', 'label-o',
@ -199,7 +199,7 @@ module.exports = {
'photo', 'photo',
'gift-card', 'gift-card',
'expand', 'expand',
'medel', 'medal',
'good-job', 'good-job',
'manager', 'manager',
'label', 'label',

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -2,25 +2,25 @@
# yarn lockfile v1 # yarn lockfile v1
"@nodelib/fs.scandir@2.0.1": "@nodelib/fs.scandir@2.1.3":
version "2.0.1" version "2.1.3"
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.0.1.tgz#120ff490365eb7a86b7f883af216382963c8436f" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b"
integrity sha512-p2mECeAoBC1G3PfTt65jKoNAd926rJTPg7RgsW7jR42Y1y/vrDkBcd9cvCKAUWB5aSaI3rBoYRE4qLw5sHjKeg== integrity sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==
dependencies: dependencies:
"@nodelib/fs.stat" "2.0.1" "@nodelib/fs.stat" "2.0.3"
run-parallel "^1.1.9" run-parallel "^1.1.9"
"@nodelib/fs.stat@2.0.1", "@nodelib/fs.stat@^2.0.0": "@nodelib/fs.stat@2.0.3", "@nodelib/fs.stat@^2.0.2":
version "2.0.1" version "2.0.3"
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.1.tgz#814f71b1167390cfcb6a6b3d9cdeb0951a192c14" resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz#34dc5f4cabbc720f4e60f75a747e7ecd6c175bd3"
integrity sha512-+RqhBlLn6YRBGOIoVYthsG0J9dfpO79eJyN7BYBkZJtfqrBwf2KK+rD/M/yjZR6WBmIhAgOV7S60eCgaSWtbFw== integrity sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==
"@nodelib/fs.walk@^1.1.0": "@nodelib/fs.walk@^1.2.3":
version "1.1.1" version "1.2.4"
resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.1.1.tgz#62b9f903397ad32b14b88de30674e6350b0f35ed" resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz#011b9202a70a6366e436ca5c065844528ab04976"
integrity sha512-MmjNq20/nGuDyc4PUSpTiiu5Hg9Q9VfQR78CGf2Yquhws9SCm+XDdxYa1niRqeVHW9nP8DQSX+tlM8bLUNsUGA== integrity sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==
dependencies: dependencies:
"@nodelib/fs.scandir" "2.0.1" "@nodelib/fs.scandir" "2.1.3"
fastq "^1.6.0" fastq "^1.6.0"
"@types/q@^1.5.1": "@types/q@^1.5.1":
@ -1010,16 +1010,15 @@ fast-deep-equal@^2.0.1:
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49"
integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=
fast-glob@^3.0.0: fast-glob@^3.1.1:
version "3.0.0" version "3.1.1"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.0.0.tgz#719bc921f2c37322affd3b6fbfcfbb135e7fc198" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.1.1.tgz#87ee30e9e9f3eb40d6f254a7997655da753d7c82"
integrity sha512-zyUoA7qfL6sIWD7FYyleqjsOZ4BbpILPrGVKM3inQV4lJ71kOqFHNX7G95PX4iVMojol01LXJ6gQW/usDLNqnQ== integrity sha512-nTCREpBY8w8r+boyFYAx21iL6faSsQynliPHM4Uf56SbkyohCNxpVPEH9xrF5TXKy+IsjkPUHDKiUkzBVRXn9g==
dependencies: dependencies:
"@nodelib/fs.stat" "^2.0.0" "@nodelib/fs.stat" "^2.0.2"
"@nodelib/fs.walk" "^1.1.0" "@nodelib/fs.walk" "^1.2.3"
glob-parent "^5.0.0" glob-parent "^5.1.0"
is-glob "^4.0.0" merge2 "^1.3.0"
merge2 "^1.2.3"
micromatch "^4.0.2" micromatch "^4.0.2"
fast-json-stable-stringify@^2.0.0: fast-json-stable-stringify@^2.0.0:
@ -1141,12 +1140,12 @@ fragment-cache@^0.2.1:
dependencies: dependencies:
map-cache "^0.2.2" map-cache "^0.2.2"
fs-extra@^8.0.1: fs-extra@^8.1.0:
version "8.0.1" version "8.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.0.1.tgz#90294081f978b1f182f347a440a209154344285b" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
integrity sha512-W+XLrggcDzlle47X/XnS7FXrXu9sDo+Ze9zpndeBxdgv88FHLm1HtmkhEwavruS6koanBjp098rUpHs65EmG7A== integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==
dependencies: dependencies:
graceful-fs "^4.1.2" graceful-fs "^4.2.0"
jsonfile "^4.0.0" jsonfile "^4.0.0"
universalify "^0.1.0" universalify "^0.1.0"
@ -1227,10 +1226,10 @@ glob-parent@^3.1.0:
is-glob "^3.1.0" is-glob "^3.1.0"
path-dirname "^1.0.0" path-dirname "^1.0.0"
glob-parent@^5.0.0: glob-parent@^5.1.0:
version "5.0.0" version "5.1.0"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.0.0.tgz#1dc99f0f39b006d3e92c2c284068382f0c20e954" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2"
integrity sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg== integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==
dependencies: dependencies:
is-glob "^4.0.1" is-glob "^4.0.1"
@ -1306,6 +1305,11 @@ graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6:
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00"
integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==
graceful-fs@^4.2.0:
version "4.2.3"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423"
integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==
gulp-cli@^2.2.0: gulp-cli@^2.2.0:
version "2.2.0" version "2.2.0"
resolved "https://registry.yarnpkg.com/gulp-cli/-/gulp-cli-2.2.0.tgz#5533126eeb7fe415a7e3e84a297d334d5cf70ebc" resolved "https://registry.yarnpkg.com/gulp-cli/-/gulp-cli-2.2.0.tgz#5533126eeb7fe415a7e3e84a297d334d5cf70ebc"
@ -2116,10 +2120,10 @@ mdn-data@~1.1.0:
resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-1.1.4.tgz#50b5d4ffc4575276573c4eedb8780812a8419f01" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-1.1.4.tgz#50b5d4ffc4575276573c4eedb8780812a8419f01"
integrity sha512-FSYbp3lyKjyj3E7fMl6rYvUdX0FBXaluGqlFoYESWQlyUTq8R+wp0rkFxoYFqZlHCvsUXGjyJmLQSnXToYhOSA== integrity sha512-FSYbp3lyKjyj3E7fMl6rYvUdX0FBXaluGqlFoYESWQlyUTq8R+wp0rkFxoYFqZlHCvsUXGjyJmLQSnXToYhOSA==
merge2@^1.2.3: merge2@^1.3.0:
version "1.2.3" version "1.3.0"
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81"
integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA== integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==
microbuffer@^1.0.0: microbuffer@^1.0.0:
version "1.0.0" version "1.0.0"
@ -3280,7 +3284,7 @@ svgicons2svgfont@^9.0.3:
svg-pathdata "^5.0.0" svg-pathdata "^5.0.0"
transformation-matrix-js "^2.7.1" transformation-matrix-js "^2.7.1"
svgo@^1.2.2: svgo@1.2.2:
version "1.2.2" version "1.2.2"
resolved "https://registry.yarnpkg.com/svgo/-/svgo-1.2.2.tgz#0253d34eccf2aed4ad4f283e11ee75198f9d7316" resolved "https://registry.yarnpkg.com/svgo/-/svgo-1.2.2.tgz#0253d34eccf2aed4ad4f283e11ee75198f9d7316"
integrity sha512-rAfulcwp2D9jjdGu+0CuqlrAUin6bBWrpoqXWwKDZZZJfXcUXQSxLJOFJCQCSA0x0pP2U0TxSlJu2ROq5Bq6qA== integrity sha512-rAfulcwp2D9jjdGu+0CuqlrAUin6bBWrpoqXWwKDZZZJfXcUXQSxLJOFJCQCSA0x0pP2U0TxSlJu2ROq5Bq6qA==

View File

@ -60,28 +60,36 @@ function AddressItem(
/> />
); );
const genContent = () => { function genTag() {
if (props.data.isDefault && props.defaultTagText) {
return (
<Tag type="danger" round class={bem('tag')}>
{props.defaultTagText}
</Tag>
);
}
}
function genContent() {
const { data } = props; const { data } = props;
const Info = [ const Info = [
<div class={bem('name')}> <div class={bem('name')}>
{`${data.name} ${data.tel}`} {`${data.name} ${data.tel}`}
{data.isDefault && props.defaultTagText && ( {genTag()}
<Tag type="danger" round class={bem('tag')}>
{props.defaultTagText}
</Tag>
)}
</div>, </div>,
<div class={bem('address')}>{data.address}</div> <div class={bem('address')}>{data.address}</div>
]; ];
return switchable && !disabled ? ( if (switchable && !disabled) {
<Radio name={data.id} iconSize={16}> return (
{Info} <Radio name={data.id} iconSize={16}>
</Radio> {Info}
) : ( </Radio>
Info );
); }
};
return Info;
}
return ( return (
<Cell <Cell
@ -106,4 +114,6 @@ AddressItem.props = {
defaultTagText: String defaultTagText: String
}; };
export default createComponent<AddressItemProps, AddressItemEvents>(AddressItem); export default createComponent<AddressItemProps, AddressItemEvents>(
AddressItem
);

View File

@ -123,7 +123,7 @@ function Card(
const priceArr = props.price!.toString().split('.'); const priceArr = props.price!.toString().split('.');
return ( return (
<div> <div>
{props.currency} <span class={bem('price-currency')}>{props.currency}</span>
<span class={bem('price-integer')}>{priceArr[0]}</span>. <span class={bem('price-integer')}>{priceArr[0]}</span>.
<span class={bem('price-decimal')}>{priceArr[1]}</span> <span class={bem('price-decimal')}>{priceArr[1]}</span>
</div> </div>

View File

@ -17,7 +17,7 @@ exports[`renders demo correctly 1`] = `
</div> </div>
<div class="van-card__bottom"> <div class="van-card__bottom">
<div class="van-card__price"> <div class="van-card__price">
<div>¥<span class="van-card__price-integer">2</span>.<span class="van-card__price-decimal">00</span></div> <div><span class="van-card__price-currency">¥</span><span class="van-card__price-integer">2</span>.<span class="van-card__price-decimal">00</span></div>
</div> </div>
<div class="van-card__num">x2</div> <div class="van-card__num">x2</div>
</div> </div>
@ -41,7 +41,7 @@ exports[`renders demo correctly 1`] = `
</div> </div>
<div class="van-card__bottom"> <div class="van-card__bottom">
<div class="van-card__price"> <div class="van-card__price">
<div>¥<span class="van-card__price-integer">2</span>.<span class="van-card__price-decimal">00</span></div> <div><span class="van-card__price-currency">¥</span><span class="van-card__price-integer">2</span>.<span class="van-card__price-decimal">00</span></div>
</div> </div>
<div class="van-card__origin-price">¥ 10.00</div> <div class="van-card__origin-price">¥ 10.00</div>
<div class="van-card__num">x2</div> <div class="van-card__num">x2</div>
@ -70,7 +70,7 @@ exports[`renders demo correctly 1`] = `
</div> </div>
<div class="van-card__bottom"> <div class="van-card__bottom">
<div class="van-card__price"> <div class="van-card__price">
<div>¥<span class="van-card__price-integer">2</span>.<span class="van-card__price-decimal">00</span></div> <div><span class="van-card__price-currency">¥</span><span class="van-card__price-integer">2</span>.<span class="van-card__price-decimal">00</span></div>
</div> </div>
<div class="van-card__num">x2</div> <div class="van-card__num">x2</div>
</div> </div>

View File

@ -10,7 +10,7 @@ import { DefaultSlots } from '../utils/types';
export type IconProps = { export type IconProps = {
dot?: boolean; dot?: boolean;
tag: keyof HTMLElementTagNameMap | string; tag: keyof HTMLElementTagNameMap | string;
name: string; name?: string;
size?: string | number; size?: string | number;
color?: string; color?: string;
info?: string | number; info?: string | number;
@ -27,17 +27,23 @@ function isImage(name?: string): boolean {
return name ? name.indexOf('/') !== -1 : false; return name ? name.indexOf('/') !== -1 : false;
} }
// compatible with legacy usage, should be removed in next major version
function correctName(name?: string) {
return name === 'medel' ? 'medal' : name;
}
function Icon( function Icon(
h: CreateElement, h: CreateElement,
props: IconProps, props: IconProps,
slots: DefaultSlots, slots: DefaultSlots,
ctx: RenderContext<IconProps> ctx: RenderContext<IconProps>
) { ) {
const imageIcon = isImage(props.name); const name = correctName(props.name);
const imageIcon = isImage(name);
return ( return (
<props.tag <props.tag
class={[props.classPrefix, imageIcon ? '' : `${props.classPrefix}-${props.name}`]} class={[props.classPrefix, imageIcon ? '' : `${props.classPrefix}-${name}`]}
style={{ style={{
color: props.color, color: props.color,
fontSize: addUnit(props.size) fontSize: addUnit(props.size)
@ -46,7 +52,7 @@ function Icon(
> >
{slots.default && slots.default()} {slots.default && slots.default()}
{imageIcon && ( {imageIcon && (
<Image class={bem('image')} fit="contain" src={props.name} showLoading={false} /> <Image class={bem('image')} fit="contain" src={name} showLoading={false} />
)} )}
<Info dot={props.dot} info={props.info} /> <Info dot={props.dot} info={props.info} />
</props.tag> </props.tag>

View File

@ -89,7 +89,7 @@ declare global {
} }
} }
const version = '2.3.0-beta.2'; const version = '2.3.0-beta.3';
const components = [ const components = [
ActionSheet, ActionSheet,
AddressEdit, AddressEdit,

View File

@ -277,13 +277,14 @@ export default createComponent({
resetStepper() { resetStepper() {
const { skuStepper } = this.$refs; const { skuStepper } = this.$refs;
const { selectedNum } = this.initialSku; const { selectedNum } = this.initialSku;
const num = isDef(selectedNum) ? selectedNum : 1; const num = isDef(selectedNum) ? selectedNum : this.startSaleNum;
// 用来缓存不合法的情况 // 用来缓存不合法的情况
this.stepperError = null; this.stepperError = null;
if (skuStepper) { if (skuStepper) {
skuStepper.setCurrentNum(num); skuStepper.setCurrentNum(num);
} else { } else {
// 当首次加载skuStepper 为空)时,传入数量如果不合法,可能会存在问题
this.selectedNum = num; this.selectedNum = num;
} }
}, },

View File

@ -112,6 +112,7 @@ export default createComponent({
methods: { methods: {
setCurrentNum(num) { setCurrentNum(num) {
this.currentNum = num; this.currentNum = num;
this.checkState(this.stepperMinLimit, this.stepperLimit);
}, },
onOverLimit(action) { onOverLimit(action) {

View File

@ -41,12 +41,17 @@ function SubmitBar(
function Text() { function Text() {
if (typeof price === 'number') { if (typeof price === 'number') {
const priceArr = (price / 100).toFixed(props.decimalLength).split('.'); const priceArr = (price / 100).toFixed(props.decimalLength).split('.');
const decimalStr = props.decimalLength ? `.${priceArr[1]}` : '';
return ( return (
<div style={{ textAlign: props.textAlign ? props.textAlign : '' }} class={bem('text')}> <div
style={{ textAlign: props.textAlign ? props.textAlign : '' }}
class={bem('text')}
>
<span>{props.label || t('label')}</span> <span>{props.label || t('label')}</span>
<span class={bem('price')}> <span class={bem('price')}>
{props.currency} {props.currency}
<span class={bem('price', 'integer')}>{priceArr[0]}</span>.{priceArr[1]} <span class={bem('price', 'integer')}>{priceArr[0]}</span>
{decimalStr}
</span> </span>
{props.suffixLabel && ( {props.suffixLabel && (
<span class={bem('suffix-label')}>{props.suffixLabel}</span> <span class={bem('suffix-label')}>{props.suffixLabel}</span>

View File

@ -65,7 +65,7 @@ use `loading` property to keep component in loading state
| cell-size | Cell sizecan be set to `large` | *string* | - | - | | cell-size | Cell sizecan be set to `large` | *string* | - | - |
| loading | whether switch is loading | *boolean* | `false` | - | | loading | whether switch is loading | *boolean* | `false` | - |
| disabled | whether to disable switch | *boolean* | `false` | - | | disabled | whether to disable switch | *boolean* | `false` | - |
| size | Size of switch | *string* | `24px` | - | | size | Size of switch | *string \| number* | `24px` | - |
| active-color | Background of switch color when active | *string* | `#1989fa` | - | | active-color | Background of switch color when active | *string* | `#1989fa` | - |
| inactive-color | Background of switch color when inactive | *string* | `#fff` | - | | inactive-color | Background of switch color when inactive | *string* | `#fff` | - |
| active-value | Value when active | *any* | `true` | - | | active-value | Value when active | *any* | `true` | - |

View File

@ -65,7 +65,7 @@ export default {
| cell-size | 单元格大小,可选值为 `large` | *string* | - | | cell-size | 单元格大小,可选值为 `large` | *string* | - |
| loading | 是否为加载状态 | *boolean* | `false` | - | | loading | 是否为加载状态 | *boolean* | `false` | - |
| disabled | 是否为禁用状态 | *boolean* | `false` | - | | disabled | 是否为禁用状态 | *boolean* | `false` | - |
| size | 开关尺寸 | *string* | `24px` | - | | size | 开关尺寸 | *string \| number* | `24px` | - |
| active-color | 开关时的背景色 | *string* | `#1989fa` | - | | active-color | 开关时的背景色 | *string* | `#1989fa` | - |
| inactive-color | 开关时的背景色 | *string* | `#fff` | - | | inactive-color | 开关时的背景色 | *string* | `#fff` | - |
| active-value | 打开时的值 | *any* | `true` | - | | active-value | 打开时的值 | *any* | `true` | - |

View File

@ -3,7 +3,7 @@
*/ */
export type SharedSwitchProps = { export type SharedSwitchProps = {
size: string; size?: string | number;
value?: any; value?: any;
loading?: boolean; loading?: boolean;
disabled?: boolean; disabled?: boolean;
@ -14,7 +14,7 @@ export type SharedSwitchProps = {
}; };
export const switchProps = { export const switchProps = {
size: String, size: [String, Number],
value: null as any, value: null as any,
loading: Boolean, loading: Boolean,
disabled: Boolean, disabled: Boolean,

View File

@ -99,7 +99,7 @@ function TreeSelect(
emit(ctx, 'update:active-id', newActiveId); emit(ctx, 'update:active-id', newActiveId);
emit(ctx, 'click-item', item); emit(ctx, 'click-item', item);
// compatible for old usage, should be removed in next major version // compatible with legacy usage, should be removed in next major version
emit(ctx, 'itemclick', item); emit(ctx, 'itemclick', item);
} }
}} }}
@ -120,7 +120,7 @@ function TreeSelect(
onChange={(index: number) => { onChange={(index: number) => {
emit(ctx, 'update:main-active-index', index); emit(ctx, 'update:main-active-index', index);
emit(ctx, 'click-nav', index); emit(ctx, 'click-nav', index);
// compatible for old usage, should be removed in next major version // compatible with legacy usage, should be removed in next major version
emit(ctx, 'navclick', index); emit(ctx, 'navclick', index);
}} }}
> >

View File

@ -1533,10 +1533,10 @@
eslint-plugin-import "^2.18.2" eslint-plugin-import "^2.18.2"
eslint-plugin-vue "^5.2.3" eslint-plugin-vue "^5.2.3"
"@vant/icons@1.1.15": "@vant/icons@1.2.0":
version "1.1.15" version "1.2.0"
resolved "https://registry.yarnpkg.com/@vant/icons/-/icons-1.1.15.tgz#53c51ace21e9992bfeeb2e1ad9094fbf6506d116" resolved "https://registry.yarnpkg.com/@vant/icons/-/icons-1.2.0.tgz#ed31f367185704fa2ef9b437a0c8d3ee5e4f5f58"
integrity sha512-96tbJotfofrKpOrUGWKkiGLJsCFc0OX5pikWLW5yarD+EMhi0zCrQSDb95xGrp/HETAFm+nSTQu2e1zGsWN/7A== integrity sha512-japcEMXv5BWyWNwjL52WX9pdMWB2wrZtvF0p0CwhbKJyoz/WxuvHVsNjzbeCtkBlofa+0txfJTt22qyz5BABaA==
"@vant/markdown-loader@^2.3.0": "@vant/markdown-loader@^2.3.0":
version "2.3.0" version "2.3.0"