反射获取声明泛型工具类
和上帝一样聪明,和天才一样幼稚。——巴尔扎克《奥诺丽纳》 工具类: 1234567891011121314151617public static Type[] getGenericTypes(Type paramType) { Type type; for (type = paramType; type instanceof Class; type = ((Class<?>) type).getGenericSuperclass()) { if (Object.class.equals(type)) { Type[] genericInterfaces = ((Class<?>) type).getGenericInterfaces(); if (genericInterfaces.length > 0 && Objects.nonNull(genericInterfaces[0])) { ...
h2从1.4.200升级到2.1.212
鲸落海底,哺暗界众生十五年。——加里·斯奈德 如果直接修改GAV版本号 12345<dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>2.1.212</version></dependency> 你会获得一堆报错 下面是我的ddl: 123456789101112131415161718192021222324drop table if exists user_info;create table if not exists user_info( id BIGINT(20) AUTO_INCREMENT NOT NULL COMMENT '主键ID', name VARCHAR(30) NULL DEFAULT NULL COMMENT '姓名', age...
x-easypdf
三月桃花,两人一马,明日天涯。——七堇年 分享一个PDF框架:https://gitee.com/dromara/x-easypdf 一个用搭积木的方式构建pdf的框架(基于pdfbox) 官方文档:https://dromara.gitee.io/x-easypdf/#/ API文档:https://apidoc.gitee.com/dromara/x-easypdf/ 项目概述 x-easypdf基于pdfbox二次封装,极大降低使用门槛,以组件化的形式进行pdf的构建。简单易用,帮助开发者快速生成pdf文档。 参考示例:https://dromara.gitee.io/x-easypdf/#/md/%E5%8F%82%E8%80%83%E7%A4%BA%E4%BE%8B 创建文档 12345678// 定义文档路径String filePath = OUTPUT_PATH + "testBuild.pdf";// 构建文档XEasyPdfHandler.Document.build( // 构建空白页 XEasyPdf...
vue3中css里的v-bind
一旦别人问起自己想要什么,那一刹那反倒什么都不想要了。——太宰治 官方文档:状态驱动的动态 CSS 编写一个组件: 123456789101112131415161718192021222324252627<template> <div class="ruben"> <p>You clicked {{ count }} times</p> <button @click="increment">Click me</button> </div></template><script>export default { data() { return { count: 1 } }, methods: { increment...
veaury
没有意义的事物是最美丽的。——《新名字的故事》 昨天分享了vuera 今天再分享一个同类型库veaury,属于是vuera的新版库 中文文档:https://github.com/devilwjp/veaury/blob/master/README_zhcn.md 什么是Veaury?Veaury 是基于React和Vue3的工具库,主要用于React和Vue在一个项目中公共使用的场景,主要运用在项目迁移、技术栈融合的开发模式、跨技术栈使用第三方组件的场景。 重要功能 🌞 支持 Vue3 🌈 支持 Context - 同一个应用中出现的vue组件和react组件的context是共享的. 💗 支持跨框架的hooks调用 - 可以在react组件中使用vue的hooks,获取到vue组件或者应用的上下文数据,比如vue-router、vuex,也可以在vue组件中使用react的hooks,获取到react组件或者应用的上下文数据,比如react-router、provide、context等
vuera
微微怪时间不能保存情绪,保存那一切情绪所曾流连的境界。——《你是人间的四月天》 分享一个开源项目:https://github.com/akxcv/vuera 它可以让你在vue里写react,在react里写vue Use Vue components in your React app: 1234567import React from 'react'import MyVueComponent from './MyVueComponent.vue'export default props => <div> <MyVueComponent message={props.message} handleReset={props.handleReset} /> </div> Or use React components in your Vue app: 1234567891011121314<template> <div&g...
vue-class-component
人的教养不能够靠别人传授,人必须进行自我修养。一切苦修也绝不是文化修养,教育是通过人的主动性来实现的,教育牢牢地钉在主动性上。——费希特 官方文档:https://class-component.vuejs.org/ class-component是vue官方库之一,其可以让你使用class的方式定义、编写组件 再加上ts的装饰器,最终效果如下: 12345678910111213141516171819202122232425262728<template> <div> <button v-on:click="decrement">-</button> {{ count }} <button v-on:click="increment">+</button> </div></template><script>import Vue from 'vue'...
泛型限定问题
双木非林,田下有心。——顾城 首先看这段代码: 12345678910111213141516171819202122import java.util.function.Function;class Scratch { static class RoleInfo { } public static void main(String[] args) { // 想让这两个通过 test(Object::hashCode, RoleInfo::hashCode, new RoleInfo()); test(Object::toString, RoleInfo::toString, new RoleInfo()); // 想让这个报错 test(Object::hashCode, RoleInfo::toString, new RoleInfo()); } public static <T, A, R> void te...
teleport
你之前学了啥跟你以后能学啥没有什么本质联系——尤雨溪 顾名思义,teleport汉译过来就是传送的意思 官方文档:https://v3.cn.vuejs.org/guide/teleport.html#teleport 它可以将我们的元素传送到指定地点: 例如我们要实现一个挂载在body上的模态框,就可以使用teleport: 12345678910111213141516171819202122232425262728const app = Vue.createApp({});app.component('modal-button', { template: ` <button @click="modalOpen = true"> Open full screen modal! (With teleport!) </button> <teleport to="body"> <div v-if=&quo...
vue3组合式api
自由自由,多少罪恶假汝之名以行。——罗兰夫人 这个思想上有点类似流程控制框架,将一个组件中的多个关注点分离、抽取,然后能进一步复用、编排 官方文档:https://v3.cn.vuejs.org/guide/composition-api-introduction.html#%E4%BB%8B%E7%BB%8D 使用上来讲,就是编写的api方式变了,举个例子: 下面是我实际写的一个小组件 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657<script lang="tsx">interface Props { msg: string; msgModifiers: { [key: string]: boolean; };}import { computed, onMounted, ref, Ref, toRefs, watch,...
