From 224f6144e667c6332d98c56cee0e025c116eca35 Mon Sep 17 00:00:00 2001 From: leejimchill Date: Wed, 12 Jul 2023 16:30:42 +0800 Subject: [PATCH] 1.1.12 (#2181) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(loading): resolve style error (#1873) * fix(loading): resolve style error * test: update unit test * feat: empty的文案添加换行 (#1870) * fix(button): 修复[button] type="submit"时,disabled未生效 (#1878) * fix(button): 修复[button] type="submit"时,disabled未生效 修复[button] type="submit"时,disabled未生效 * fix(button): 修复[button] type="submit"时,disabled未生效 修复[button] type="submit"时,disabled未生效 * test: update snap --------- Co-authored-by: zjianzzhang * style(row): row垂直居中样式 (#1866) 添加row的flex布局,垂直居中 * fix(progress): 安卓机朗读异常 & 动态朗读 (#1354) * fix: 安卓机朗读异常 * fix: fix code * fix: 安卓不发音 * fix: fix code * fix: wip 优化中 * fix: 优化 * chore: update snap * fix: fix code * fix: fix code * fix: 错误使用iOS变量 * fix(补充注释): 补充注释 * fix: 优化 * test: update snap * fix: 补充注释 * fix: 优化部分注释, remove code * fix: 优化注释 --------- Co-authored-by: leejimqiu * feature/swiper aria v2 (#1598) * feat(swiper): support aria * feat(swiper): support custom ariaLabel * feat(swiper): image name * chore(swiper): update snap --------- Co-authored-by: leejimqiu * docs: update custom theme * fix(radio): resolve style (#1889) * feat: 支持分割线组件的线条使用变量控制属性 (#1890) * fix(action-sheet): resolve ts error of show method (#1907) * fix(grid): 修复column>=4个时,--td-grid-item-image-width和--td-grid-item-text-font-size是无效的 (#1903) * chore: update _common (#1902) * feat: 支持radio的内容字体大小使用变量。 (#1895) * feat: 支持radio的内容字体大小使用变量。 * style: 修改css变量名称 * Bitjian fix/radio icon size (#1909) * fix: 修复--td-radio-icon-size对未选中的图标未生效 * fix: fix radio 未选择的图标未生效 * fix(radio): support css variables to change circle icon size --------- Co-authored-by: bitjian <1183048003@qq.com> * chore: publish v1.1.2 (#1910) * chore: publish v1.1.2 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] * fix(rate): 评分组件支持无障碍滑动 (#1574) * fix(rate): 评分组件支持滑动无障碍操作(#1050) * fix(rate): 评分组件样式问题修复.(#1050) * fix(rate): 评分组件单测问题.(#1050) * fix(rate): 抽象样式, 冗余代码.(#1050) * fix(rate): 删除冗余节点.(#1050) * fix(rate): 优化读取.(#1050) * fix(rate): 新增额外的读取.(#1050) * fix(rate): 修复警告旁白导致的滑动卡顿.(#1050) * fix(rate): sr-only注释(#1050) * fix(rate): update test snapshots. (#1050) * build: remove preview workflow tentatively * fix(upload): resolve max (#1914) * fix(navbar): resolve capsule zindex (#1920) * chore: update site * fix(button): 修复variant=outline等状态下loading不展示 (#1922) * fix(button): 修复variant=outline等状态下loading不展示 * fix(button): loading inheritColor 字段错误 * fix(navbar): resolve vertical align (#1926) * fix(navbar): resolve vertical align * test(navbar): update snapshot * fix(dropdown-menu): support multiple column radio (#1927) * fix(Link): resolve disabled problem (#1928) * fix(calendar): resolve error (#1930) * fix(calendar): resolve error * fix(calendar): make observer robust * fix(tabs): resolve content overflow (#1931) * fix(tabs): resolve content overflow * test(tabs): update snapshot * chore: update issue template * fix(Input): resolve vertical layout style error (#1934) * feat(collapse): add header-left-icon property (#1933) * feat(tabs): add middle slot (#1936) * chore: publish v1.1.3 (#1937) * chore: publish v1.1.3 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] * fix(slider): enable dragstart and dragend event (#1940) * fix(image-viewer): add using-custom-navation property (#1944) * feat(Swiper): update api docs (#1945) * feat(Swiper): update api docs * Update CHANGELOG.md * fix(picker): enable to using falsy value (#1948) * fix(toast): auto hide when page is hide (#1947) * feat(swiper): add image-load event (#1949) * feat(swiper): add image-load event * fix: resolve fallback value * test: update snapshot * chore: publish v1.1.4 (#1950) * chore: publish v1.1.4 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] * docs(picker): enrich api detail (#1956) * fix(tabs): resolve track position (#1958) * feat(pulldown-refresh): add some properties from scroll-view (#1959) * feat(pulldown-refresh): add some properties from scroll-view * refactor(pulldown-refresh): using px to calculate * feat(loading): support indicator slot * test: update snapshot * fix(pulldown-refresh): resolve value (#1960) * feat(datetime-picker): support steps property (#1961) * feat(steps): add sequence property (#1962) * feat(dropdown-menu): add css variable for border width (#1967) * feat(Stepper): allow input to be empty (#1971) * fix(calendar): enable scroll into view when use-popup is false (#1969) * chore(image-viewer): update demo (#1968) * chore(image-viewer): update demo * chore(image-viewer): update demo * fix(action-sheet): enable close when click cancel * chore: recover demo * chore: publish v1.1.5 (#1975) * chore: publish v1.1.5 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] * docs(badge): update api * fix(navbar): Fix invalid fixed attribute of Navbar component (#1982) * feat(Icon): update icon from 0.1.2 to 0.1.4 (#1979) * feat(Icon): update iconform 0.1.2 to 0.1.4 * test: update snapshots * chore: update _common * Feat/picker-zindex (#1985) * feat: picker添加层级控制 * refactor: 修改popupProps的处理逻辑 * refactor: fix template error * fix: picker compile error * fix(DropdownMenu): auto scroll to current (#1788) (#1981) * fix(DropdownMenu): auto scroll to current (#1788) * fix(DropdownMenu): resolve auto scroll wrong height (#1788) * fix(DropdownMenu): auto multi scroll to current (#1788) * feat: 添加支持date-picker的蒙层属性透 (#1991) * feat(Slider): the step attribute supports decimals (#1990) * feat(Slider): the step attribute supports decimals * fix(slider): resolve emit same value --------- Co-authored-by: leejimqiu * chore: publish v1.1.5-beta * fix(pulldown-refresh): resolve refresh event * fix: 修复variant动态修改无效 * feat(Grid): enrich demo (#1993) * feat(Input): resolve label content wraps (#1994) * docs(Steps): remove invalid attributes (#1995) * fix(pulldown-refresh): resolve refresh event (#1998) * fix(pulldown-refresh): resolve refresh event * fix(pulldown-refresh): resolve change event * fix: fix [下拉菜单] 单选选项行高不一致 #1980 (#1992) * feat: action-sheet支持层级 (#2002) * fix: 修复多余 row 的样式导致 col 不换行问题 (#1996) * fix: 修复row样式问题 fix #1964, fix #1851 * fix: 修复多余 row 的样式导致 col 不换行问题 "fix #1964", "fix #1851" --------- Co-authored-by: pingwu * fix(dialog): display of cancel and confirm button when calling a command. (#1986) * fix(dialog): Display problem of cancel and confirm button when calling a command. * revert(dialog): Revert changes to ` dialog.wxml` * fix(dialog): Button issue when invoking commands. --------- Co-authored-by: yuchumian * fix(calendar): enable calendar type (#2003) * chore: publish v1.1.6 (#2004) * chore: publish v1.1.6 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] * chore(ActionSheet): prohibit exporting components at index (#2008) * feat: action-sheet支持cancel的颜色变量 (#2007) * fix(sticky): resolve width (#2012) * fix(side-bar-item): fix prefix and suffix style anomalies (#2011) * fix(tabbar): resolve width when virtual-host not available (#2013) * chore: publish v1.1.6-beta * build: update npm publish * fix(action-sheet): resolve invalid syntax * fix(Icon): rename some icons (#2020) * fix(Icon): rename some icons * test: update snapshots * chore: publish v1.1.7 (#2031) * chore: publish v1.1.7 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] * feat(Textarea): support max/min height (#2035) * feat(Textarea): support max/min height * test: update snapshots * fix: rename proposal to transform and display installation dependencies (#2046) * fix(DropdownMenu): resolved the basic library cannot be used under version 2.19.2 (#2043) * fix(DropdownMenu): resolved the basic library cannot be used under version 2.19.2 * test: update snapshots * fix(Sticky): resolved width problem (#2047) * fix(Sticky): resolved width problem * fix(sticky): recover classname --------- Co-authored-by: leejimqiu * fix(navbar): polish bg support (#2049) * fix(drawer): resolve word misspelling (#2039) * fix(drawer): item-click parameter error * fix(drawer): item-click parameter error * fix(drawer): item-click parameter error * fix(image): enable dynamic dimension (#2050) * chore: publish v1.1.8 (#2051) * chore: publish v1.1.8 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] * fix(indexes): 索引导航无法选中问题 (#2036) * fix(indexes): 异步数据未重新计算高度 * docs(indexes): 增加async文档说明 * fix(indexes): 通过indexList null判断是否异步数据 * fix(indexes): 修改indexList type类型 * feat(switch): prevent click when the switch component props loading is true (#2061) * feat(checkbox): 自定义图标增加半选中态 (#2056) * feat(Search): support cursor-spacing attr (#2065) * feat(Search): support cursor-spacing attr * test: update snapshots * fix(Switch): resolved loading state style (#2074) * fix(Icon): resolved icon naming error (#2076) * fix(tree-select): enable keys property (#2085) * fix(radio-group): fix abnormal display of radio group selection status (#2082) * fix(radio-group): fix abnormal display of radio group selection status * fix(radio-group): fix abnormal display of radio group selection status * docs(slider): add faq part * fix(CellGroup): resolved borderen invalid (#2089) * chore: publish v1.1.9 (#2091) * chore: publish v1.1.9 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] * feat(notice-bar): add interval property when direction='vertical' * test(notice-bar): add interval property when direction='vertical' * fix(Grid): resolved align='laft' valid (#2110) * fix(Fab): resolved hover-class invalid (#2093) * fix(upload): fix abnormal image display (#2098) * feat(tabs): add split property (#2113) * fix(slider): fix abnormal calculation of slider mark (#2114) * fix(Input): resolve value=0 is valid when type is number (#2108) * fix(slider): enable async render (#2115) * fix: add type check before call pagescroll (#2116) * build: remove issue assign logic * fix(action-sheet): do not trigger close event when disabled (#2117) * fix(stepper): trigger change when value changed (#2118) * chore: publish v1.1.10 (#2119) * chore: publish v1.1.10 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] * fix(tabs): fix style anomalies caused by too many tabs items (#2123) * fix(picker): fix default value is invalid (#2126) * feat(checkbox-group): add borderless property (#2124) * feat(checkbox-group): add borderless property * test(checkbox-group): add borderless property * fix(Stepper): resolved precision problem (#2130) * fix(radio): fix vertical align (#2135) * fix(checkbox): resolve align when icon size changed (#2136) * docs(checkbox): update (#2137) * docs(checkbox): update * fix(checkbox): resolve priority of disabled property * fix(search): catch tap event when trigger clear (#2139) * fix(search): catch tap event when triiger clear * test(search): update snapshot * docs: update used page * fix(divider): replace external class (#2140) * fix(divider): replace external class * test: update snapshot * feat(radio): enable allow-uncheck (#2141) * feat(radio): enable allow-uncheck * feat(radio-group): add allowUncheck for RadioOption * test(radio-group): add allowUncheck for RadioOption * feat(radio-group): update change value * fix(toast): resolve repeated event triggering (#2146) * feat(dropdown-item): add close event (#2147) * fix: resolve console warnings (#2149) * Update README.md (#2150) * fix(popup): update width when placement is bottom (#2152) * chore: publish v1.1.11 (#2153) * chore: publish v1.1.11 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] * test: remove snapshot for virtual-host (#2161) * test: remove snapshot for virtual-host * test: update config * test: update config * fix(*): resolve console warn (#2164) * fix: 修复rate组件选中没有生效 (#2158) * fix: 修复rate组件选中没有生效 修复rate组件选中没有生效 * fix: 导致父组件tap失效 * fix(rate): uncatch event (#2168) * feat(pull-down-refresh): 增加show-scrollbar参数 (#2163) * docs(pulldown-refresh): add show-scrollbar property * fix(picker): observe value (#2169) * fix(tabs): enable scroll smoothly (#2170) * fix(tree-select): enable value with empty array (#2173) * chore: publish v1.1.12 (#2175) * chore: publish v1.1.12 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] --------- Co-authored-by: Cyrus Co-authored-by: favouredddd <40692560+favouredddd@users.noreply.github.com> Co-authored-by: 孜孜 <1183048003@qq.com> Co-authored-by: zjianzzhang Co-authored-by: tomcat-hz <59186135+tomcat-hz@users.noreply.github.com> Co-authored-by: 龙风 <455947455@qq.com> Co-authored-by: zhangpaopao Co-authored-by: Guan9 Co-authored-by: Y Co-authored-by: github-actions[bot] Co-authored-by: byqbai Co-authored-by: betavs <34408516+betavs@users.noreply.github.com> Co-authored-by: jarmywang Co-authored-by: jurrychen <534747442@qq.com> Co-authored-by: pingwu <58472278+wuping97@users.noreply.github.com> Co-authored-by: pingwu Co-authored-by: yuchumian <26185330+yuchumian@users.noreply.github.com> Co-authored-by: yuchumian Co-authored-by: ElanYoung <39727435+ElanYoung@users.noreply.github.com> Co-authored-by: betavs <392368711@qq.com> Co-authored-by: Antzy --- CHANGELOG.md | 13 ++++++ jest.virtualHost.config.js | 37 ---------------- package.json | 9 ++-- script/test/setup.js | 25 ++++++++++- script/test/snapshotResolver.js | 12 ------ script/test/virtualHostSetup.js | 43 ------------------- src/common/template/button.wxml | 2 +- src/dialog/index.ts | 2 +- src/message/__test__/index.test.js | 5 --- .../__test__/__snapshots__/index.test.js.snap | 8 ++-- src/picker/picker.ts | 2 +- src/pull-down-refresh/README.en-US.md | 1 + src/pull-down-refresh/README.md | 1 + src/pull-down-refresh/props.ts | 5 +++ src/pull-down-refresh/pull-down-refresh.wxml | 1 + src/pull-down-refresh/type.ts | 8 ++++ src/rate/rate.ts | 4 +- src/rate/rate.wxml | 10 ++--- src/tabs/tabs.ts | 5 ++- src/tabs/tabs.wxml | 2 + src/tree-select/tree-select.ts | 2 +- 21 files changed, 77 insertions(+), 120 deletions(-) delete mode 100644 jest.virtualHost.config.js delete mode 100644 script/test/snapshotResolver.js delete mode 100644 script/test/virtualHostSetup.js diff --git a/CHANGELOG.md b/CHANGELOG.md index aa9b0093e..fcbd39c53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ toc: false docClass: timeline --- +## 🌈 1.1.12 `2023-07-11` +### 🚀 Features +- `PullDownRefresh`: 增加 show-scrollbar 属性 @lolhezihehe ([#2163](https://github.com/Tencent/tdesign-miniprogram/pull/2163)) +### 🐞 Bug Fixes +- `Rate`: 修复无法点击的问题 @AntzyMo ([#2158](https://github.com/Tencent/tdesign-miniprogram/pull/2158)) +- `Rate`: 使事件冒泡至上层元素 @LeeJim ([#2168](https://github.com/Tencent/tdesign-miniprogram/pull/2168)) +- `DateTimePicker`: 修复无法选择的问题 @betavs ([#2169](https://github.com/Tencent/tdesign-miniprogram/pull/2169)) +- `Tabs`: 修复超出时滚动不流畅的问题 @LeeJim ([#2170](https://github.com/Tencent/tdesign-miniprogram/pull/2170)) +- `TreeSelect`: 修复多选时 value 使用空数组报错的问题 @LeeJim ([#2173](https://github.com/Tencent/tdesign-miniprogram/pull/2173)) +### 🚧 Others +- 移除开启 virtual-host 场景的 snapshot 测试 @LeeJim ([#2161](https://github.com/Tencent/tdesign-miniprogram/pull/2161)) +- 修复控制台告警 @betavs ([#2164](https://github.com/Tencent/tdesign-miniprogram/pull/2164)) + ## 🌈 1.1.11 `2023-07-04` ### 🚀 Features - `CheckboxGroup`: 新增 borderless 属性 @betavs ([#2124](https://github.com/Tencent/tdesign-miniprogram/pull/2124)) diff --git a/jest.virtualHost.config.js b/jest.virtualHost.config.js deleted file mode 100644 index 1f25661ea..000000000 --- a/jest.virtualHost.config.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * virtualHost 的开启和关闭对 dom 渲染会产生较大差异,且在单测中无法通过 selectComponent 获取子组件实例, - * 故设置两个 jest 配置文件,区分 virtualHost 的两种状态。 - */ - -module.exports = { - verbose: true, - testEnvironment: 'jsdom', - testURL: 'http://localhost/', - moduleFileExtensions: ['js', 'ts'], - moduleNameMapper: { - '^tdesign-miniprogram/(.*)': '/src/$1', - }, - testMatch: ['/src/**/__test__/**/*.test.{js,ts}'], - collectCoverageFrom: ['/src/**/*.{js,ts}', '!**/__test__/**', '!**/_example/**'], - collectCoverage: true, - coverageProvider: 'v8', - coverageDirectory: '/test/unit-virtualHost/coverage', - reporters: [ - 'default', - [ - './node_modules/jest-html-reporter', - { - pageTitle: 'TDesign-miniprogram Unit Test Report(virtualHost)', - outputPath: './test/unit-virtualHost/report/test-report.html', - }, - ], - ], - setupFiles: ['/script/test/virtualHostSetup.js'], - coverageReporters: ['html', 'json-summary'], - globals: { - CONFIG_PREFIX: 't', - }, - globalSetup: '/script/test/globalSetup.js', - snapshotSerializers: ['miniprogram-simulate/jest-snapshot-plugin'], - snapshotResolver: '/script/test/snapshotResolver.js', -}; diff --git a/package.json b/package.json index bf6151f77..76d3b025d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tdesign-miniprogram", "purename": "tdesign", - "version": "1.1.11", + "version": "1.1.12", "description": "tdesign-miniprogram", "title": "tdesign-ßminiprogram", "main": "miniprogram_dist/index.js", @@ -31,9 +31,8 @@ "site:intranet": "cd site && vite build --mode intranet", "site:prerender": "node script/prerender.mjs", "cover": "jest --coverage", - "test": "jest && jest -c jest.virtualHost.config.js && jest -c jest.e2e.config.js", - "test:virtualHost": "jest -c jest.virtualHost.config.js", - "test:snap-update": "npm run test:virtualHost -- -u && npm run test:unit -- -u", + "test": "jest && jest -c jest.e2e.config.js", + "test:snap-update": "npm run test:unit -- -u", "test:demo": "node gen-demo-test.js", "test:unit": "jest", "test:e2e": "jest -c jest.e2e.config.js", @@ -94,7 +93,7 @@ "lodash": "^4.17.21", "miniprogram-api-typings": "^3.4.6", "miniprogram-automator": "^0.10.0", - "miniprogram-simulate": "^1.5.7", + "miniprogram-simulate": "^1.6.0", "npm-run-all": "^4.1.5", "playwright": "^1.19.1", "prettier": "^2.0.5", diff --git a/script/test/setup.js b/script/test/setup.js index af8a50d11..5b32222d7 100644 --- a/script/test/setup.js +++ b/script/test/setup.js @@ -1,5 +1,6 @@ import Path from 'path'; import simulate from 'miniprogram-simulate'; +import similateApi from 'miniprogram-simulate/src/api'; import { canUseVirtualHost } from '../../src/common/version'; global.getApp = () => null; @@ -13,5 +14,27 @@ global.load = (path, demoName) => { }, }); }; - +global.wx = { + ...similateApi, + getSystemInfoSync: () => { + return { + SDKVersion: '2.19.1', + batteryLevel: 100, + benchmarkLevel: 1, + brand: 'devtools', + fontSizeSetting: 16, + language: 'zh_CN', + model: 'iPhone 7 Plus', + pixelRatio: 3, + platform: 'devtools', + screenHeight: 736, + screenWidth: 414, + statusBarHeight: 20, + system: 'iOS 10.0.1', + version: '6.6.3', + windowHeight: 672, + windowWidth: 414, + }; + }, +}; global.VIRTUAL_HOST = canUseVirtualHost(); diff --git a/script/test/snapshotResolver.js b/script/test/snapshotResolver.js deleted file mode 100644 index 47664f502..000000000 --- a/script/test/snapshotResolver.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - // resolves from test to snapshot path - resolveSnapshotPath: (testPath, snapshotExtension) => - testPath.replace('__test__', '__test__/__virtualHostSnapshot__') + snapshotExtension, - - // resolves from snapshot to test path - resolveTestPath: (snapshotFilePath, snapshotExtension) => - snapshotFilePath.replace('__test__/__virtualHostSnapshot__', '__test__').slice(0, -snapshotExtension.length), - - // Example test path, used for preflight consistency check of the implementation above - testPathForConsistencyCheck: 'some/__tests__/example.test.js', -}; diff --git a/script/test/virtualHostSetup.js b/script/test/virtualHostSetup.js deleted file mode 100644 index 7ddc3fc70..000000000 --- a/script/test/virtualHostSetup.js +++ /dev/null @@ -1,43 +0,0 @@ -import Path from 'path'; -import simulate from 'miniprogram-simulate'; -import similateApi from 'miniprogram-simulate/src/api'; -import { canUseVirtualHost } from '../../src/common/version'; - -global.getApp = () => null; -global.Page = (options) => Component(options); -global.load = (path, demoName) => { - return simulate.load(path, demoName, { - less: true, - rootPath: Path.resolve(__dirname, '../../src'), - compilerOptions: { - maxBuffer: 1024 * 1024 * 2, - }, - }); -}; - -global.wx = { - ...similateApi, - getSystemInfoSync: () => { - return { - // SDKVersion > 2.19.2, 开启 VirtualHost - SDKVersion: '2.20.0', - batteryLevel: 100, - benchmarkLevel: 1, - brand: 'devtools', - fontSizeSetting: 16, - language: 'zh_CN', - model: 'iPhone 7 Plus', - pixelRatio: 3, - platform: 'devtools', - screenHeight: 736, - screenWidth: 414, - statusBarHeight: 20, - system: 'iOS 10.0.1', - version: '6.6.3', - windowHeight: 672, - windowWidth: 414, - }; - }, -}; - -global.VIRTUAL_HOST = canUseVirtualHost(); diff --git a/src/common/template/button.wxml b/src/common/template/button.wxml index 27d6bc493..faff528bd 100644 --- a/src/common/template/button.wxml +++ b/src/common/template/button.wxml @@ -14,7 +14,7 @@ size="{{size || 'medium'}}" variant="{{variant || 'base'}}" open-type="{{openType || ''}}" - hover-class="{{hoverClass}}" + hover-class="{{hoverClass || ''}}" hover-stop-propagation="{{hoverStopPropagation || false}}" hover-start-time="{{hoverStartTime || 20}}" hover-stay-time="{{hoverStayTime || 70}}" diff --git a/src/dialog/index.ts b/src/dialog/index.ts index 5cfac79a5..f9c538f8b 100644 --- a/src/dialog/index.ts +++ b/src/dialog/index.ts @@ -37,7 +37,7 @@ interface DialogActionOptionsType { } const defaultOptions = { - actions: false, + actions: [], buttonLayout: props.buttonLayout.value, cancelBtn: props.cancelBtn.value, closeOnOverlayClick: props.closeOnOverlayClick.value, diff --git a/src/message/__test__/index.test.js b/src/message/__test__/index.test.js index f0192ab51..4299fa21e 100644 --- a/src/message/__test__/index.test.js +++ b/src/message/__test__/index.test.js @@ -1,13 +1,8 @@ import simulate from 'miniprogram-simulate'; import path from 'path'; -import similateApi from 'miniprogram-simulate/src/api'; import Message from '../index'; import * as Util from '../../common/utils'; -global.wx = { - ...similateApi, -}; - const mockGetRect = jest.spyOn(Util, 'getRect'); mockGetRect.mockImplementation(() => { return new Promise((resolve) => resolve({ height: 46, width: 156 })); diff --git a/src/navbar/__test__/__snapshots__/index.test.js.snap b/src/navbar/__test__/__snapshots__/index.test.js.snap index 198a82e20..803ab3731 100644 --- a/src/navbar/__test__/__snapshots__/index.test.js.snap +++ b/src/navbar/__test__/__snapshots__/index.test.js.snap @@ -40,7 +40,7 @@ exports[`navbar :base 2`] = ` { const { width, left } = rect; @@ -77,7 +77,7 @@ export default class Rate extends SuperComponent { }, onTouchMove(e: WechatMiniprogram.TouchEvent) { this.onTouch(e, 'move'); - this.showAlertText() + this.showAlertText(); }, onTouchEnd() { this.touchEnd = true; diff --git a/src/rate/rate.wxml b/src/rate/rate.wxml index 5feb342b7..961afe23f 100644 --- a/src/rate/rate.wxml +++ b/src/rate/rate.wxml @@ -5,11 +5,11 @@ diff --git a/src/tree-select/tree-select.ts b/src/tree-select/tree-select.ts index 87a2e0810..784400736 100644 --- a/src/tree-select/tree-select.ts +++ b/src/tree-select/tree-select.ts @@ -66,7 +66,7 @@ export default class TreeSelect extends SuperComponent { if (multiple) { const finalValue = this.data.value || this.data.defaultValue; - if (!Array.isArray(finalValue[leafLevel])) { + if (finalValue[leafLevel] != null && !Array.isArray(finalValue[leafLevel])) { throw TypeError('应传入数组类型的 value'); } }