feat: 新增首页IP交互
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { defineProps, computed } from "vue";
|
||||
import { defineProps, computed, getCurrentInstance, defineExpose } from "vue";
|
||||
import ChatMoreTips from "../ChatMoreTips/index.vue";
|
||||
|
||||
const props = defineProps({
|
||||
@@ -54,6 +54,25 @@ const props = defineProps({
|
||||
const initPageImages = computed(() => props.mainPageDataModel.initPageImages);
|
||||
const welcomeContent = computed(() => props.mainPageDataModel.welcomeContent);
|
||||
const guideWords = computed(() => props.mainPageDataModel.guideWords);
|
||||
|
||||
// Welcome 可视状态与高度
|
||||
const instance = getCurrentInstance();
|
||||
|
||||
// 测量欢迎区域高度
|
||||
const measureWelcomeHeight = (callback) => {
|
||||
uni
|
||||
.createSelectorQuery()
|
||||
.in(instance)
|
||||
.select(".welcome-content")
|
||||
.boundingClientRect((res) => {
|
||||
if (res && res.height) {
|
||||
callback(res);
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
};
|
||||
|
||||
defineExpose({ measureWelcomeHeight });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user