1
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<script lang="uts">
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
emits:['change','destory'],
|
||||
props:{
|
||||
id:{
|
||||
type:String,
|
||||
default:''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getNodeinfo(){
|
||||
let t = this;
|
||||
uni.createSelectorQuery()
|
||||
.in(t)
|
||||
.select('.xTabsItemChildren')
|
||||
.boundingClientRect((rect:any)=>{
|
||||
t.$emit('change',rect as NodeInfo,t.id)
|
||||
}).exec()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getNodeinfo()
|
||||
},
|
||||
|
||||
beforeUnmount() {
|
||||
this.$emit('destory',this.id)
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<view class="xTabsItemChildren">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</template>
|
||||
<style>
|
||||
.xTabsItemChildren{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user