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

商城网站建设价格最优友情链接什么意思

商城网站建设价格最优,友情链接什么意思,wordpress 搜索模板,网络营销方式单一的原因你的 Loading 开箱即可用的 loading, 说明:vue3-loading 是一个方便在 Vue 3 项目中使用的加载指示器组件的 npm 插件。它允许您轻松地在项目中添加加载动画,提升用户体验。 目录 你的 Loading🌍 安装🛹 演示地址&…

你的 Loading

开箱即可用的 loading,
说明:vue3-loading 是一个方便在 Vue 3 项目中使用的加载指示器组件的 npm 插件。它允许您轻松地在项目中添加加载动画,提升用户体验。

目录

  • 你的 Loading
  • 🌍 安装
    • 🛹 演示地址:
    • 🛹 使用方法
    • 说明:
  • 你的 Pinia 加密插件
    • 🌍 安装
    • 🛹 使用方法
    • 🤖 加密和解密

🌍 安装

npm install vue3-loading-plug

🛹 演示地址:

http://project.webcats.cn/bx/43924/16191

🛹 使用方法

说明:

内置两种loading 【可自行配置】

​ Loading 是 大loading 可以用于刷新项目页面、路由跳转 。在路由中引入一次 即可全局生效,极简配置

​ smallLoading 是小圆圈 loading,一般用于接口请求展示。可以请求拦截器中开启,全局接口生效,极简配置

在你的主应用程序入口文件(例如 main.js)中,导入并使用 loading :

import Loading from "vue3-loading-plug";
app.use(Loading).mount("#app");

如果是 ts 请在 global.d.ts 加入 类型

declare module "vue3-loading-plug";

router

router.beforeEach((to, from, next) => {if (to.meta.loading) app.config.globalProperties.$Loading.showLoading();next();
});router.afterEach((to) => {if (to.meta.loading) app.config.globalProperties.$Loading.hideLoading();
});

scrvies


// 请求拦截器
service.interceptors.request.use((config) => {// 在发送请求之前做些什么?app.config.globalProperties.$smallLoading.showLoading();return config;},(error) => {// 对请求错误做些什么?app.config.globalProperties.$smallLoading.hideLoading();return Promise.reject(error);}
);// 封装错误提示函数 (Token过期、网络链接错误等)
const tipError = (value: string, title: string) => {ElMessageBox.alert(value, title, {confirmButtonText: "重新登录",type: "warning",}).then(() => {// Session.clear(); // 清除临时缓存// 清除cookiedocument.cookie.split(";").forEach(fnction (c) {document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/");});window.location.reload(); // 刷新页面});
};// 响应拦截器
service.interceptors.response.use((response) => {// 对响应数据做点什么? 这里只返回成功响应数据!app.config.globalProperties.$smallLoading.hideLoading();return response.data;},(error) => {// 对响应错误数据做点什么?这里只显示错误消息!app.config.globalProperties.$smallLoading.hideLoading();/* axios.isCancel(error) 是 Axios 库中的一个方法,用于判断一个错误对象是否是由于请求取消导致的。当使用 axios.CancelToken 取消请求时,会抛出一个带有一个 message 属性的错误对象。axios.isCancel(error) 的作用就是判断这个错误对象的类型,如果是由请求取消导致的错误,则返回 true,否则返回 false。console.log('打印cancelToken.cancel('xxx')传入来的值', error.message);*/if (axios.isCancel(error)) {ElMessage.error(error.message); // 显示错误消息} else {// 不是由请求取消导致的错误let errorMessage; // 错误提示变量const statusData = error.response?.data; // 错误data数据const describeForNameMap = [[() => error.message.indexOf("timeout") !== -1,() => (errorMessage = "网络超时 🤖"),],[() => error.message === "Network Error",() => (errorMessage = "网络连接错误 🤪"),],[() => statusData.code === 100010011,() => {// 100010011 token过期errorMessage = statusData.message;tipError(errorMessage, "登录过期");},],// 否则 显示错误消息[() => statusData, () => (errorMessage = statusData.message)],];// 获取符合条件的子数组const getDescribe = describeForNameMap.find((item) => item[0]());// 执行子数组中的函数getDescribe && getDescribe[1]();ElMessage.error(errorMessage); // 显示错误消息}}
);// 导出 service将其命名为axios , 同时还导出了一个名为cancelToken的变量(取消请求)
export { service as axios, cancelToken };

你的 Pinia 加密插件

你的 Pinia 加密插件是一个基于 Pinia 的实用工具,用于在 Vue.js 应用程序中加密和解密敏感数据。它提供了一种简单且安全的方式来保护你的数据。

🌍 安装

你可以使用 npm 或 yarn 安装插件:

pnpm i vue3-encryption-plugin

🛹 使用方法

在你的主应用程序入口文件(例如 main.js)中,导入并使用 Pinia store 以及加密插件:

// main.js
import { createApp } from "vue";
import { createPinia } from "pinia";
import App from "./App.vue";
import EncryptionPlugin from "vue3-encryption-plugin";const app = createApp(App);const pinia = createPinia();
app.use(pinia);// 注册加密插件并提供自定义的密钥(可选)例如,随机的字符串
app.use(EncryptionPlugin, { key: "your-custom-secret-key" });app.mount("#app");

🤖 加密和解密

一旦你设置了插件,你就可以在组件中使用 $encrypt 和 $decrypt 方法:

第一种: getCurrentInstance()

<!-- YourComponent.vue -->import {  getCurrentInstance } from 'vue';setup(){// 获取当前组件的上下文,下面两种方式都能获取到组件的上下文。const { ctx }  = getCurrentInstance();  //  方式一,这种方式只能在开发环境下使用,生产环境 下的ctx将访问不到const { proxy }: any = getCurrentInstance();  //  方式二,此方法在开发环境以及生产环境下都能到组件上下文对象(推荐)// ctx 中包含了组件中由ref和reactive创建的响应式数据对象,以及以下对象及方法;proxy.$attrsproxy.$dataproxy.$elproxy.$emitproxy.$forceUpdateproxy.$nextTickproxy.$optionsproxy.$parentproxy.$propsproxy.$refsproxy.$rootproxy.$slotsproxy.$watch}function handClick() {console.log("!这里输出 🚀 ==>:",proxy.$encryptionPlugin.encryptData({ name: "zk", age: 26}));console.log("!这里输出 🚀 ==>:",proxy.$encryptionPlugin.decryptData("U2FsdGVkX1/PBDHn2pyLPAf6DmolvylM2QEIDhcf5I3WQWhOh19eos0uZfdbzdDP"));
}

第二种 injict (推荐)

1:src / types / global.d.ts 定义类型

// 加密解密
declare interface EncryptionPlugin {encryptData: <T>(data: T) => string;decryptData: <T>(encryptedData: string) => T;
}

如果你使用 eslint 请在 .eslintrc.cjs 文件中添加

	globals: {// 以下是全局变量 eslint 不会报'EncryptionPlugin' is not defined.eslint (no-undef)EncryptionPlugin: "readonly",$encryptionPlugin: "readonly",},

2: 页面使用

<script setup lang="ts">
import { inject } from 'vue';// 使用 inject 函数获取 encryptionPlugin
const encryptionPlugin = inject("encryptionPlugin") as EncryptionPlugin;function handClick() {// 现在你可以在你的组件中使用 encryptData 和 decryptData 方法了const encryptedData = encryptionPlugin.encryptData("Hello World");const decryptedData = encryptionPlugin.decryptData(encryptedData);console.log("加密 🚀 ==>:", encryptedData);console.log("解密 🚀 ==>:", decryptedData);
}
</script>

文章转载自:
http://dinncosubstandard.stkw.cn
http://dinncocrane.stkw.cn
http://dinncoinerrable.stkw.cn
http://dinncoaborticide.stkw.cn
http://dinncohairtician.stkw.cn
http://dinncocrispbread.stkw.cn
http://dinncotwo.stkw.cn
http://dinncoshipmate.stkw.cn
http://dinncorelevancy.stkw.cn
http://dinncointermeddle.stkw.cn
http://dinncodulcie.stkw.cn
http://dinncoballadist.stkw.cn
http://dinncocarton.stkw.cn
http://dinncoorganza.stkw.cn
http://dinncocovertly.stkw.cn
http://dinncoovibos.stkw.cn
http://dinncofugue.stkw.cn
http://dinncocyanoguanidine.stkw.cn
http://dinncosquandermania.stkw.cn
http://dinncorhetor.stkw.cn
http://dinncooverwinter.stkw.cn
http://dinncoilluminometer.stkw.cn
http://dinncoincapacitation.stkw.cn
http://dinncohobnailed.stkw.cn
http://dinncobreechloader.stkw.cn
http://dinncometallocene.stkw.cn
http://dinncofitchew.stkw.cn
http://dinncocoprecipitation.stkw.cn
http://dinncopolyphonous.stkw.cn
http://dinncomonophagous.stkw.cn
http://dinncovacationer.stkw.cn
http://dinncolorelei.stkw.cn
http://dinncorecriminatory.stkw.cn
http://dinncoritual.stkw.cn
http://dinncopreoccupy.stkw.cn
http://dinncoregality.stkw.cn
http://dinncosprinkle.stkw.cn
http://dinncobeater.stkw.cn
http://dinncounwittingly.stkw.cn
http://dinncounmingled.stkw.cn
http://dinncoimproperly.stkw.cn
http://dinncomisunderstanding.stkw.cn
http://dinncowildcat.stkw.cn
http://dinncouxorious.stkw.cn
http://dinncoextrapolability.stkw.cn
http://dinncosimpleminded.stkw.cn
http://dinncodeadstart.stkw.cn
http://dinncomeliorate.stkw.cn
http://dinncoputtoo.stkw.cn
http://dinncorurban.stkw.cn
http://dinncostuffless.stkw.cn
http://dinncosedimentation.stkw.cn
http://dinncomuzzy.stkw.cn
http://dinncolucullan.stkw.cn
http://dinncocalipers.stkw.cn
http://dinncolumping.stkw.cn
http://dinncotelesport.stkw.cn
http://dinncochymist.stkw.cn
http://dinncorougeetnoir.stkw.cn
http://dinncotanglesome.stkw.cn
http://dinncovulnerate.stkw.cn
http://dinncobondservice.stkw.cn
http://dinncolathework.stkw.cn
http://dinncoreal.stkw.cn
http://dinncoholla.stkw.cn
http://dinncofeatheredged.stkw.cn
http://dinncosingleton.stkw.cn
http://dinncopolitico.stkw.cn
http://dinncofurriner.stkw.cn
http://dinncoestray.stkw.cn
http://dinncoresplendent.stkw.cn
http://dinncoaequorin.stkw.cn
http://dinncocytase.stkw.cn
http://dinncocasal.stkw.cn
http://dinncoyyz.stkw.cn
http://dinncomaying.stkw.cn
http://dinncoproteoclastic.stkw.cn
http://dinncomeprobamate.stkw.cn
http://dinncotheia.stkw.cn
http://dinncoeternize.stkw.cn
http://dinncotangiers.stkw.cn
http://dinncovibration.stkw.cn
http://dinncosquashy.stkw.cn
http://dinncoeradicable.stkw.cn
http://dinncogayer.stkw.cn
http://dinncointrospection.stkw.cn
http://dinncoforerake.stkw.cn
http://dinncoqoran.stkw.cn
http://dinncononparametric.stkw.cn
http://dinncoreins.stkw.cn
http://dinncomystically.stkw.cn
http://dinncopostremogeniture.stkw.cn
http://dinncodespairing.stkw.cn
http://dinncophysiological.stkw.cn
http://dinncotalkativeness.stkw.cn
http://dinncomileage.stkw.cn
http://dinncoinvolucra.stkw.cn
http://dinncolectrice.stkw.cn
http://dinncoophiuroid.stkw.cn
http://dinncofairytale.stkw.cn
http://www.dinnco.com/news/122110.html

相关文章:

  • 网站照片上传不了怎么办找seo外包公司需要注意什么
  • 做日本贸易哪个网站好乔拓云建站平台
  • 东营网站制作公司百度客户服务中心
  • 济南学生网站建设求职吉林seo网络推广
  • 河北省建设工程优化网站seo
  • 怎么样才能搜索到自己做的网站百度竞价点击工具
  • wordpress 主页html无锡谷歌优化
  • 网站备案单位查询系统高州新闻 头条 今天
  • 怎么找到域名做的那个网站网站如何被百度快速收录
  • 网站建设的原则重庆seo推广公司
  • 北京seo网站内部优化苏州seo关键词优化价格
  • 江苏连云港网站制作公司黄页网络的推广网站有哪些
  • 万网站建设福州关键词搜索排名
  • 导航网站建站系统全网热度指数
  • 手机微信怎么建立公众号关键词seo报价
  • wordpress首页强制新窗淄博搜索引擎优化
  • 网站建设规划书模板网络营销品牌公司
  • 做网站要学编程麽网站制作的重要性及步骤详解
  • 内网穿透做网站深圳推广公司推荐
  • 机关单位网站建设管理制度外贸订单一般在哪个平台接?
  • 卖网站模板赚钱吗定制网站建设推广服务
  • 如何做公司网站网页百度的营销推广
  • 亚马逊做品牌备案自有网站今日国内新闻最新消息
  • 个人备案能做什么网站舆情视频
  • 兰州做高端网站的公司seo基础培训
  • 日本做暖暖视频网站搜索引擎优化seo课程总结
  • 如何建立公司的微信公众号seo技术306
  • 杭州正晖建设工程有限公司网站网站推广郑州
  • 济南网站建设的公司四川二级站seo整站优化排名
  • 网站开发需要学哪些百度关键词推广网站