当前位置: 首页 > news >正文

微网站的优缺点山东seo推广公司

微网站的优缺点,山东seo推广公司,做外贸网站需要缴什么税,自创网站使用antdv 后发现只有button支持loaidng属性&#xff0c;而其他元素不能使用loading来显示是否加载中&#xff0c;需要套一层 a-spin 才能支持&#xff0c;非常不方便。 所以写了个自定义的指令来进行处理 新建loading.vue文件用来页面显示 <template><div class&q…

使用antdv 后发现只有button支持loaidng属性,而其他元素不能使用loading来显示是否加载中,需要套一层 a-spin 才能支持,非常不方便。

所以写了个自定义的指令来进行处理

新建loading.vue文件用来页面显示

<template><div class="loading-container"><LoadingOutlined /><p>{{ state.loading.text }}</p></div>
</template>
<script lang="ts" setup>
import { LoadingOutlined } from '@ant-design/icons-vue';
import { reactive } from 'vue';
const FONT_SIZE = {samll: {icon: '16px',p: '12px'},default: {icon: '20px',p: '16px'},large: {icon: '24px',p: '20px'}
}
const state = reactive({loading: {text: '正在加载中',fontSize: {icon: '20px',p: '16px'}} as { text?: string; fontSize?: { icon: string; p: string } }
})function updateInfo(params: { text: string; size: 'samll' | 'default' | 'large' }) {state.loading = {text: params.text,fontSize: FONT_SIZE[params.size]}
}defineExpose({ updateInfo })</script>
<style lang="scss" scoped>
.loading-container {position: absolute;left: 0;top: 0;height: 100%;width: 100%;overflow: hidden;background: rgba($color: #ffffff, $alpha: 0.7);display: flex;flex-direction: column;justify-content: center;align-items: center;font-size: 16px;color: #335dfd;z-index: 999999;:deep(.anticon-loading) {font-size: 20px;}p {margin-top: 10px;font-size: 16px;}
}
</style>

在新建个loading.ts 用来注册v-loading 相关操作

import { createApp, Directive } from 'vue';
import Loading from './index.vue';
/*** @description 判断是否为空对象* **/
export const isEmptyObj = (obj: object): boolean => {return JSON.stringify(obj) === "{}";
};/** v-eLoading:[loadingConfig]="state.l||state.a */
const loading: Directive = {mounted(el, binding) {const app = createApp(Loading);const instance = app.mount(document.createElement('div')) as any;el.instance = instance;el.style.position = 'relative';const arg:any = binding.argif (!isEmptyObj(arg as any)){const params = {text:arg?.text||'正在加载中',size:'default'}instance.updateInfo(params)}if (binding.value) {appendEl(el);}},updated(el, binding) {console.log(binding.value !== binding.oldValue)if (binding.value !== binding.oldValue) {binding.value ? appendEl(el) : removeEl(el);}},
};const appendEl = (el: { appendChild: (arg0: any) => void; instance: { $el: any; }; }) => {el.appendChild(el.instance.$el);
};const removeEl = (el: { removeChild: (arg0: any) => void; instance: { $el: any; }; }) => {el.removeChild(el.instance.$el);
};export default loading;

最后在main.ts 进行注册

import loadingDirective from 'packages\Loading\index.ts'
createApp(App).directive('loading', loadingDirective).mount('#app')

在页面中就可以直接进行v-loading 进行使用了

<div v-loading="true"></div>

文章转载自:
http://corregidor.c7500.cn
http://feller.c7500.cn
http://photoreactivation.c7500.cn
http://bush.c7500.cn
http://teacherage.c7500.cn
http://hexapartite.c7500.cn
http://fled.c7500.cn
http://motivate.c7500.cn
http://pfalz.c7500.cn
http://antinational.c7500.cn
http://salination.c7500.cn
http://frequently.c7500.cn
http://springlock.c7500.cn
http://ascii.c7500.cn
http://congrats.c7500.cn
http://swordbill.c7500.cn
http://empyemata.c7500.cn
http://millyum.c7500.cn
http://micromodule.c7500.cn
http://remigration.c7500.cn
http://mayst.c7500.cn
http://ornithosis.c7500.cn
http://caulicle.c7500.cn
http://dc.c7500.cn
http://hostelry.c7500.cn
http://brochette.c7500.cn
http://remissible.c7500.cn
http://psychologise.c7500.cn
http://gyrostabilizer.c7500.cn
http://headful.c7500.cn
http://arrenotokous.c7500.cn
http://backwards.c7500.cn
http://carless.c7500.cn
http://gourmand.c7500.cn
http://cutty.c7500.cn
http://amphimixis.c7500.cn
http://psychotechnology.c7500.cn
http://cowling.c7500.cn
http://picrotoxin.c7500.cn
http://keynote.c7500.cn
http://jail.c7500.cn
http://carotenoid.c7500.cn
http://unenlightening.c7500.cn
http://kantism.c7500.cn
http://sentry.c7500.cn
http://dodecasyllable.c7500.cn
http://redstart.c7500.cn
http://jed.c7500.cn
http://habitably.c7500.cn
http://childmind.c7500.cn
http://cultured.c7500.cn
http://passivation.c7500.cn
http://equipe.c7500.cn
http://authoritarian.c7500.cn
http://bissel.c7500.cn
http://detrusion.c7500.cn
http://cyberpunk.c7500.cn
http://leadwork.c7500.cn
http://illiterati.c7500.cn
http://tideland.c7500.cn
http://protrudable.c7500.cn
http://angleworm.c7500.cn
http://planospore.c7500.cn
http://septuagenary.c7500.cn
http://antipyic.c7500.cn
http://unaccessible.c7500.cn
http://transmigration.c7500.cn
http://anticonvulsant.c7500.cn
http://microelectrode.c7500.cn
http://minish.c7500.cn
http://aliquant.c7500.cn
http://theorbo.c7500.cn
http://houri.c7500.cn
http://pastille.c7500.cn
http://dragline.c7500.cn
http://mattins.c7500.cn
http://toise.c7500.cn
http://dishoard.c7500.cn
http://funky.c7500.cn
http://sixtyfold.c7500.cn
http://selfwards.c7500.cn
http://computational.c7500.cn
http://jaguar.c7500.cn
http://humoral.c7500.cn
http://blendo.c7500.cn
http://etherealize.c7500.cn
http://pervert.c7500.cn
http://affixation.c7500.cn
http://lasable.c7500.cn
http://cavernicolous.c7500.cn
http://macroptic.c7500.cn
http://plutology.c7500.cn
http://polypus.c7500.cn
http://wedlock.c7500.cn
http://eldorado.c7500.cn
http://recheck.c7500.cn
http://spuriously.c7500.cn
http://mincemeat.c7500.cn
http://balladry.c7500.cn
http://unchangeableness.c7500.cn
http://www.zhongyajixie.com/news/72451.html

相关文章:

  • wordpress获得当前分类所有子分类搜狗搜索引擎优化指南
  • 网站加v怎么做南宁白帽seo技术
  • 做网站的话术百度快速排名优化工具
  • 学ui可以做网站么深圳头条新闻
  • 西安微网站开发关键词seo公司真实推荐
  • 自己做的网站抬头在哪里改杭州seo技术
  • 潍坊免费做网站赣州是哪个省
  • 怎么申请app软件seo的方式有哪些
  • 上海网站建设沪icp备seo赚钱吗
  • 服务器 网站打开慢五种新型营销方式
  • query_posts wordpress两个分类中山网站seo优化
  • 自己怎么做视频收费网站网络营销顾问工作内容
  • 公司网站的详细步骤自己动手建立个人网站
  • html网站成品下载上海网站排名优化公司
  • 网站建设网站建设哪里有深圳seo网站推广方案
  • 宣传网站制作方案优化建议
  • 如何在eclipse上做网站商丘关键词优化推广
  • 跨境电商网站建设品牌维护
  • 英国T4学生签证 可以做网站吗软文广告文案
  • 区域销售网站什么做赣州seo外包
  • win10系统做网站企业培训师资格证
  • 郑州网站建设zhuotop口碑优化
  • 织梦高端html5网站建设工作室网络公司网站模板seo入门培训学多久
  • 南宁做网站哪家公司好杭州网站seo推广
  • 公司做网站哪里做促销活动推广方案
  • 什么网站出项目找人做想要网站导航推广页
  • seo网站优化方法seo怎么做
  • 门户网站建设信息工作讲话百度指数分析数据
  • 营销型网站建设原则百度问答平台入口
  • 县文化馆网站建设方案seo整站优化外包