笔记

万物寻其根,通其堵,便能解其困。
  博客园  :: 新随笔  :: 管理

uniapp/Vue 节点处理

Posted on 2025-01-04 10:04  草妖  阅读(1)  评论(0)    收藏  举报

获取节点宽度信息

// 获取节点信息
                // uniapp获取
                var query = uni.createSelectorQuery().in(this);
                query.select('.content-tips-area').boundingClientRect(data => {
                    if (data) {
                        //console.log('节点宽度:', data.width);
                        _this.leftVal=data.width/2;
                        _this.adjustAreaFlag=true;
                        setTimeout(function(){
                            _this.$parent.tipsDialogTypeGClear();
                        },3000);
                    }
                }).exec();
                // vue网页获取
                //this.leftVal=this.$refs.contentTipsArea.clientWidth/2;

待续....