Files
PC-Light-Forum/component/huddle-box/huddle-box.js
DESKTOP-RQ919RC\Pc 43556292d2 fix(component): 修复组件名称错误和props类型定义
refactor(component): 重构组件模板结构,移除重复代码

feat(component): 添加可选props支持外部数据传入

style(css): 优化样式布局和响应式设计

fix(js): 修复URL路径处理逻辑和滚动加载问题

feat(search): 新增搜索页推荐内容和空状态处理

chore: 添加新图标资源文件
2025-12-22 19:01:00 +08:00

31 lines
1.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// my-component.js
// 引入全局 Vue 对象(因在 HTML 中通过 script 引入Vue 已挂载到 window
const { defineComponent, ref, inject, defineAsyncComponent, onMounted } = Vue;
// 定义组件(直接使用模板)
export const huddleBox = defineComponent({
name: "huddle-box",
props: {},
setup(props) {
let isMobile = ref(false);
let state = ref(false);
onMounted(() => {
isMobile.value = window.isMobile;
});
const open = () => (state.value = true);
const closeGroup = () => (state.value = false);
const holdback = () => {};
return { state, isMobile, holdback, closeGroup, open };
},
components: {},
template: `<div class="huddle-box" @click="closeGroup" v-if="state"> <div class="box flexflex" @click.stop="holdback"> <img class="bj" src="../../img/group-bj.svg" alt=""> <img class="bj-bottom" src="../../img/group-bottom.png" alt=""> <img class="top" src="../../img/group-top.png" alt=""> <img class="title" src="../../img/group-title.png" alt=""> <div class="text">抱团 / 信息共享 / 互助申学</div> <div class="case flexflex"> <div class="QRcode flexcenter"> <img class="img" src="https://o.x-php.com/Zvt57TuJSUvkyhw-xG7Y2l-c-5kpcnzqqsgFptxhcq_cQnrlJKN1WgxCBq_D-81qNDQyOQ~~" alt=""> </div> <div class="hint flexcenter"> <img class="img img-left" src="../../img/group-arrows.png" alt=""> <span class="hint-text">添加寄托葱哥进群</span> <img class="img" src="../../img/group-arrows.png" alt=""> </div> </div> </div> </div>`,
});