Skip to content

Commit

Permalink
fix(collapse ): taro H5 环境适配 (jd-opensource#546)
Browse files Browse the repository at this point in the history
* fix: 折叠面板适配小程序

* docs: 折叠面板文档修改

* fix: 折叠面板H5环境适配
  • Loading branch information
Ymm0008 authored Jul 23, 2021
1 parent f273f4f commit e65cd8f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
28 changes: 16 additions & 12 deletions src/packages/__VUE/collapseitem/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ export default create({
const onTransitionEnd = () => {
nextTick(() => {
parent.children.forEach((item1: any, index: number) => {
item1.$el.children.forEach((item2: any, index: number) => {
let ary = Array.from(item1.$el.children);
ary.forEach((item2: any, index: number) => {
if (item2.className.includes('collapse-wrapper')) {
item2.style.willChange = 'auto';
}
Expand Down Expand Up @@ -226,17 +227,20 @@ export default create({
});
const getH = () => {
parent.children.forEach((item1: any, index: number) => {
item1.$el.children.forEach((item2: any, index: number) => {
item2.children.length > 0 &&
item2.children.forEach((item3: any, index: number) => {
if (domID.includes(item3.uid)) {
const h = list.filter((item4: any) => item4.id == item3.uid)[0]
?.height;
item1.conHeight = h;
}
});
});
parent.children.forEach((item1: any, index1: number) => {
let ary: any = Array.from(item1.$el.children);
item1.conHeight = ary[1].children[0].offsetHeight;
// ary.forEach((item2: any, index2: number) => {
// let ary2 = Array.from(item2.children);
// ary2.length > 0 &&
// ary2.forEach((item3: any, index3: number) => {
// if (domID.includes(item3.uid)) {
// const h = list.filter((item4: any) => item4.id == item3.uid)[0]
// ?.height;
// item1.conHeight = h;
// }
// });
// });
});
};
Expand Down
14 changes: 7 additions & 7 deletions src/sites/mobile-taro/vue/project.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
"appid": "wxf2b976b67dab3882",
"setting": {
"urlCheck": true,
"es6": true,
"enhance": true,
"postcss": true,
"es6": false,
"enhance": false,
"postcss": false,
"preloadBackgroundData": false,
"minified": true,
"minified": false,
"newFeature": false,
"coverView": true,
"nodeModules": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": true,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
Expand All @@ -36,7 +36,7 @@
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
"minifyWXSS": false
},
"compileType": "miniprogram",
"simulatorType": "wechat",
Expand Down

0 comments on commit e65cd8f

Please sign in to comment.