49 lines
745 B
Plaintext
49 lines
745 B
Plaintext
<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> |