摘要: 我们在做vue2项目的时候,往往弹窗设置都挺负责的需要各种z-indx,而vue3推荐的做法是使用Teleport <!-- index.html--> <body> <div id="app"></div> <div id="teleport-target"></div> <script type 阅读全文
posted @ 2021-12-26 11:26 王小美丶 阅读(171) 评论(0) 推荐(0) 编辑
摘要: import { defineAsyncComponent, ref, provide } from 'vue'; // 父组件 const emit = defineAsyncComponent(() => import('../../components/edit/index.vue')) co 阅读全文
posted @ 2021-12-20 22:28 王小美丶 阅读(7589) 评论(0) 推荐(1) 编辑
摘要: var MyCubeRect = echarts.graphic.extendShape({ shape: { x: 0, y: 0, }, buildPath: function (ctx, shape) { const api = shape.api; const xAxisPoint = ap 阅读全文
posted @ 2021-12-15 15:31 王小美丶 阅读(534) 评论(0) 推荐(0) 编辑
摘要: vue项目打包压缩 vue-cli-service build --report 打包完成会产生report.html 通过这个文件可以得知项目体积以及个个依赖大小,打包完成后开启nginx压缩 安装压缩包 npm i compression-webpack-plugin -D vue.config 阅读全文
posted @ 2021-12-12 15:04 王小美丶 阅读(1093) 评论(0) 推荐(0) 编辑
摘要: (async () => { const fetchData = () => { return new Promise((resolve, reject) => { setTimeout(() => { resolve('fetch data is me') }, 1000) }) } // 抽离成 阅读全文
posted @ 2021-12-01 18:05 王小美丶 阅读(361) 评论(0) 推荐(0) 编辑
摘要: 在编写 JS 代码时,经常会遇到逻辑判断复杂的情况。一般情况下,可以用 if/else 或 switch 来实现多个条件判断,但会出现一个问题:随着逻辑复杂度的增加,代码中的 if/else 和 switch 会越来越臃肿 if (status == 1) { // 逻辑1 } else if (s 阅读全文
posted @ 2021-08-30 16:09 王小美丶 阅读(441) 评论(0) 推荐(0) 编辑
摘要: let newArr = [] allMonth.forEach(el=> { const res = newArr.findIndex(ol=> { return el.month ol.month; }); if (res !== -1) { newArr[res].value = newArr 阅读全文
posted @ 2021-08-18 16:53 王小美丶 阅读(325) 评论(0) 推荐(0) 编辑
摘要: github上找到的然后自己稍微改了一下,省的后面要找找不到 地址 // 搜索下拉框 var flag = true ; (function(root, factory) { if (typeof exports 'object') { //umd module.exports =factory($ 阅读全文
posted @ 2021-06-08 17:21 王小美丶 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 只需要加上这几个css就好了 bottom: 0; box-sizing: content-box; padding-bottom: constant(safe-area-inset-bottom); // 自定义导航解决ios底部黑线问题 padding-bottom: env(safe-area 阅读全文
posted @ 2021-03-31 15:57 王小美丶 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 在讲解这些属性之前,假如我们项目的目录的结构如下: ### 目录结构如下: demo1 # 工程名 | | dist # 打包后生成的目录文件 | | node_modules # 所有的依赖包 | | app | | | index | | | |-- views # 存放所有vue页面文件 | 阅读全文
posted @ 2021-02-23 16:56 王小美丶 阅读(817) 评论(0) 推荐(0) 编辑