摘要:
setState 何时同步何时异步? 点击查看代码 1、setState 只在合成事件(react 为了解决跨平台,兼容性问题,自己封装了一套事件机制, 代理了原生的事件,像在 jsx 中常见的 onClick、onChange 这些都是合成事件)和钩子函数(生命 周期)中是“异步”的,在原生事件和 阅读全文
posted @ 2022-11-12 11:50
Cherishe
阅读(57)
评论(0)
推荐(0)
摘要:
//安装 yarn add screenfull@5.0.0 //导入 import screenfull from 'screenfull' //模块位置: <svg-icon icon-class="fullscreen" style="margin-right: 20px" @click="f 阅读全文
posted @ 2022-11-12 11:33
Cherishe
阅读(257)
评论(0)
推荐(0)
摘要:
export default { // 按钮权限 methods: { showBtn(code) { return ( this.$store.state.user.userInfo.roles && this.$store.state.user.userInfo.roles.points.inc 阅读全文
posted @ 2022-11-12 10:41
Cherishe
阅读(22)
评论(0)
推荐(0)
摘要:
//解决:切换帐号时上一帐号权限会影响下一帐号 import { resetRouter } from '@/router' // 删除用户信息与token logout(state) { state.token = '' state.userInfo = '' // 重置路由 resetRoute 阅读全文
posted @ 2022-11-12 10:13
Cherishe
阅读(25)
评论(0)
推荐(0)
摘要:
directives/index.js 自定义指令: // 按钮权限控制 showButton: { inserted(dom, obj) { if (!store.state.user.userInfo.roles.points.includes(obj.value)) { dom.style.d 阅读全文
posted @ 2022-11-12 10:06
Cherishe
阅读(30)
评论(0)
推荐(0)
摘要:
Proxy error: Could not proxy request /sys/profile from localhost:8888 to http://localhost:3000/api. See https://nodejs.org/api/errors.html#errors_comm 阅读全文
posted @ 2022-11-12 09:47
Cherishe
阅读(32)
评论(0)
推荐(0)
摘要:
<template> <!-- 查: 1:定义api 2:导入api 3:进入页面就调用api获取数据并存储 4:渲染数据 增: 1:创建一个弹框组件 2:导入注册使用 3:点击新增打开弹框 4:完成弹框组件布局 5:完成表单验证 6:定义与导入新增api 7:在表单验证成功后调用新增api 8:调 阅读全文
posted @ 2022-11-12 09:26
Cherishe
阅读(51)
评论(0)
推荐(0)
摘要:
<template> <!-- 组件v-model xxx v-model='abc' :value="abc" @input="abc=$event" xxx组件内 props:{ abc:{ required:true, } } this.$emit('input',实参值) --> <!-- 阅读全文
posted @ 2022-11-12 09:24
Cherishe
阅读(28)
评论(0)
推荐(0)
摘要:
/* eslint-disable */ // 1:下载 file-saver xlsx,如果出现问题,如果以前是yarn,先执行yarn 如果还不行,再执行npm i 再运行,如果还不行自行调整版本 yarn add 插件名@版本号 // // 文件下载生成 import { saveAs } f 阅读全文
posted @ 2022-11-12 09:06
Cherishe
阅读(237)
评论(0)
推荐(0)
摘要:
/* eslint-disable */ import { saveAs } from 'file-saver' import JSZip from 'jszip' export function export_txt_to_zip(th, jsonData, txtName, zipName) { 阅读全文
posted @ 2022-11-12 09:04
Cherishe
阅读(36)
评论(0)
推荐(0)

浙公网安备 33010602011771号