|
@@ -58,6 +58,10 @@ import {
|
|
|
getCurrentInstance,
|
|
getCurrentInstance,
|
|
|
ComponentInternalInstance
|
|
ComponentInternalInstance
|
|
|
} from 'vue';
|
|
} from 'vue';
|
|
|
|
|
+import Taro, {
|
|
|
|
|
+ eventCenter,
|
|
|
|
|
+ getCurrentInstance as getCurrentInstanceTaro
|
|
|
|
|
+} from '@tarojs/taro';
|
|
|
import { createComponent } from '@/packages/utils/create';
|
|
import { createComponent } from '@/packages/utils/create';
|
|
|
const { create, componentName } = createComponent('collapse-item');
|
|
const { create, componentName } = createComponent('collapse-item');
|
|
|
|
|
|
|
@@ -180,6 +184,7 @@ export default create({
|
|
|
const currentName = computed(() => props.name);
|
|
const currentName = computed(() => props.name);
|
|
|
const toggleOpen = () => {
|
|
const toggleOpen = () => {
|
|
|
console.log('点击了——————-----');
|
|
console.log('点击了——————-----');
|
|
|
|
|
+ console.log(document.getElementsByClassName('collapse-content')[0]);
|
|
|
|
|
|
|
|
if (parent.props.accordion) {
|
|
if (parent.props.accordion) {
|
|
|
parent.children.forEach((item: any, index: number) => {
|
|
parent.children.forEach((item: any, index: number) => {
|
|
@@ -232,6 +237,19 @@ export default create({
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 获取 DOM 元素
|
|
|
|
|
+ eventCenter.once((getCurrentInstanceTaro() as any).router.onReady, () => {
|
|
|
|
|
+ let a = document.getElementsByClassName('collapse-wrapper')[0];
|
|
|
|
|
+ console.log(a);
|
|
|
|
|
+
|
|
|
|
|
+ // const query = Taro.createSelectorQuery()
|
|
|
|
|
+ // query.select('.collapse-wrapper').boundingClientRect()
|
|
|
|
|
+ // query.exec(res => {
|
|
|
|
|
+ // console.log(res, 'res')
|
|
|
|
|
+ // })
|
|
|
|
|
+ // console.log('onReady')
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
// proxyData.classDirection = parent.props.expandIconPosition;
|
|
// proxyData.classDirection = parent.props.expandIconPosition;
|
|
|
// if (parent.props.icon && parent.props.icon != 'none') {
|
|
// if (parent.props.icon && parent.props.icon != 'none') {
|
|
|
// proxyData.iconStyle['background-image'] =
|
|
// proxyData.iconStyle['background-image'] =
|