摘要: 用库pubsub-js库 一、在终端安装库,命令 npm i pubsub-js 二、 在需要接受消息的组件导入库 import pubsub from 'pubsub-js' mounted(){ this.pubid=pubsub.subscribe('hello',function(_,dat 阅读全文
posted @ 2021-12-17 20:51 浩鑫 阅读(87) 评论(0) 推荐(0)
摘要: 一、安装全局事件总线: 首先在main.js中要定一个x,$bus作为数据中转中心 new vue({ beforCreate(){ this.prototype.$bus=this }) 二、在School.vue中注册一个事件: mounted(){ this.$bus.$on('hello', 阅读全文
posted @ 2021-12-17 20:10 浩鑫 阅读(87) 评论(0) 推荐(0)
摘要: 可以用来:子组件=>父组件传递数据 一、绑定和使用自定义事件 在父组件中写子组件的自定义事件(给子组件绑定事件),在子组件中调用 在App.vue中 <Student @customevent="demo">第一种直接绑定自定义事件</Student > <Student ref="student  阅读全文
posted @ 2021-12-16 22:12 浩鑫 阅读(67) 评论(0) 推荐(0)
摘要: localstorage和sessionstorage的API一样,统称webstorage,一般支持5M 储存在localstorage的不随着浏览器关闭还消失 储存在sessionstorage,会话储存,清空缓存会消失,浏览器关闭随即消失 一、储存 1,直接储存字符串,如果是数字会自动转化为字 阅读全文
posted @ 2021-12-16 19:54 浩鑫 阅读(522) 评论(0) 推荐(0)
摘要: 1.从百度网盘下载 方法1:https://pan.baidu.com/s/1557qbs6kdvzhXpgGRfJnpA 提取码:xdyk 方法2.:我的网盘>vue-devtools 2.打开谷歌浏览器 (输入)chrome://extensions/ 3.加载已解压的扩展程序。 阅读全文
posted @ 2021-12-15 20:58 浩鑫 阅读(332) 评论(0) 推荐(0)
摘要: 张天禹淘宝笔记https://juejin.cn/column/6994968647185727525 第一步:如果出现下载缓慢请配置npm淘宝镜像npm config set registry https://registry.npm.taobao.org第二步:全局安装--仅仅第一次执行 npm 阅读全文
posted @ 2021-12-14 23:04 浩鑫 阅读(1272) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-12-05 19:25 浩鑫 阅读(19) 评论(0) 推荐(0)
摘要: Nuget安装:Microsoft.AspNetCore.Authentication.JwtBearer appsetting.json中添加配置项 public class LoginController : ControllerBase { public IConfiguration Conf 阅读全文
posted @ 2021-11-22 22:14 浩鑫 阅读(220) 评论(0) 推荐(0)
摘要: 1,泛型方法 2,泛型类 Public Class PersonHelper<T>Where T:Person,new()//确定了该类一定是 Person类或子类 new()表示可以用T t=new T();来实例化 { //用反射来进行T的实例化 T o=(T)Activator.CreateI 阅读全文
posted @ 2021-11-18 19:33 浩鑫 阅读(65) 评论(0) 推荐(0)
摘要: 1,反射获取程序集的三种方式 Assembly assenbly=Assembly.LoadFile()//这种只需要提供程序集的名称 Assembly assenbly=Assembly.LoadFile(Path)//这种需要程序集 的路径 Assembly assenbly=Assembly. 阅读全文
posted @ 2021-11-18 13:28 浩鑫 阅读(44) 评论(0) 推荐(0)