20 lines
619 B
JavaScript
20 lines
619 B
JavaScript
// my-component.js
|
||
// 引入全局 Vue 对象(因在 HTML 中通过 script 引入,Vue 已挂载到 window)
|
||
const { defineComponent, ref, onMounted, onUnmounted } = Vue;
|
||
|
||
// 定义组件(直接使用模板)
|
||
export const loadBox = defineComponent({
|
||
name: "load-box",
|
||
props: {
|
||
loading: {
|
||
type: String,
|
||
default: "",
|
||
},
|
||
},
|
||
setup(props) {
|
||
return { };
|
||
},
|
||
|
||
template: `<div class="list-load-box flexcenter" :class="{'show': loading}"><img class="list-load-icon" src="/img/load-icon.svg" /><div class="list-load-text">加载中</div></div>`,
|
||
});
|