36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
// my-component.js
|
||
// 引入全局 Vue 对象(因在 HTML 中通过 script 引入,Vue 已挂载到 window)
|
||
const { defineComponent, ref, inject, defineAsyncComponent, onMounted } = Vue;
|
||
|
||
// 定义组件(直接使用模板)
|
||
export const groupPop = defineComponent({
|
||
name: "group-pop",
|
||
props: {},
|
||
|
||
setup(props) {
|
||
let isMobile = ref(false);
|
||
|
||
let state = ref(false);
|
||
|
||
let valueUrl = ref("");
|
||
|
||
onMounted(() => {
|
||
isMobile.value = window.isMobile;
|
||
|
||
const valueA = document.querySelector(".valueA");
|
||
valueUrl.value = valueA.innerText;
|
||
});
|
||
|
||
const open = () => (state.value = true);
|
||
const closeGroup = () => (state.value = false);
|
||
|
||
const holdback = () => {};
|
||
|
||
return { valueUrl, state, isMobile, holdback, closeGroup, open };
|
||
},
|
||
|
||
components: {},
|
||
|
||
template: `<div class="group-pop" v-if="state" @click="closeGroup"> <img class="bj" @click.stop="holdback" :src="valueUrl + '/img/huddle-bj.jpg'"> <img class="QRCode" @click.stop="holdback" src="https://o.x-php.com/Zvt57TuJSUvkyhw-xG7Y2l-c-5kpcnzqqsgFptxhcq_cQnrlJKN1WgxCBq_D-81qNDQyOQ~~"></div>`,
|
||
});
|