如题,分享自用的阿拉伯数字金额转成中文大写,支持负数,单位元,小数支持2位数(角、分),网上摘录的,看到的比较靠谱的一个, 测试结果如下: System.out.println(NumberToWords.convertToWords(-3.14)); // 负叁元壹角肆分 System.out.println(NumberToWords.convertToWords(10002)); // 壹万零贰元整 public class NumberToWords { private static final Strin…

2023-11-25 0条评论 430点热度 0人点赞 admin 阅读全文

Java使用freemaker导出word,使用的是ftl模板文件,本质是xml的格式。 如果在某个地方,内容还没有撑满一页的情况下,需要强制换到下一页,要如何做到呢? 编辑ftl模板文件,在需要强行分页的地方,增加如下代码即可: <w:p><w:r><w:br w:type="page"/></w:r></w:p>  

2023-11-22 0条评论 308点热度 0人点赞 admin 阅读全文

某些场景下,需要使用自定义的字体,例如类似计算器的显示效果,还有用户的手机使用了卡通字体的效果,但是希望我们的应用还是需要显示传统的字体。 实现方式: 准备好自定义字体包(后缀名为.ttf, .otf, .eot等格式的字体包),进入项目中在assets文件夹下建一个font文件夹,把字体文件放进去 把拿到的字体包放到font文件夹中接着创建一个font.css文件,内容如下(以pingfang字体为例): @font-face { font-family: 'PingFang-RE'; /* 重命名字体名 */ …

2023-11-11 0条评论 225点热度 0人点赞 admin 阅读全文

使用Spring提供的一个下载Office文档的接口报错(具体是使用Apache POI生成OfficeExcel和Word文件),直接输出到HttpServletResponse的OutputStream流,如下报错: org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException: Fail to save: an error occurs while saving the package : The part /docProps/core.xml f…

2023-10-24 0条评论 389点热度 0人点赞 admin 阅读全文

iView(View UI Design) 在使用表单操作表单内组件(例如选择框等)的时候,控制台会有个报错,如下: vue.min.js:6 TypeError: Cannot read properties of undefined (reading 'indexOf') at a.resetField (iview.min.js:1:229577) at a.required (iview.min.js:1:227418) at fn.run (vue.min.js:6:27749) at un (vue.m…

2023-10-17 0条评论 202点热度 0人点赞 admin 阅读全文

Linux上运行Python3程序的时候,报如下错误: ModuleNotFoundError: no module named '_ssl' 或者pip3 install的时候,遇到如下错误: pip is configured with locations that require tls/ssl can't connect to https url because the ssl module is not available 原因是没有安装正确的openssl 首先确保安装了openssl11,如下: yu…

2023-10-14 0条评论 214点热度 0人点赞 admin 阅读全文

因为域名有限,所以想把vue项目部署在某个域名的二级路径上,例如:https://www.example.com/someapp/下 nginx的配置如下: location ^~ /someapp/ { index index.html; alias /opt/someapp/; try_files $uri $uri/ /someapp/index.html; } 在/opt/下新建someapp目录,里面放的就是vue项目打包后的html文件 修改路由文件:router/index.js,主要是history…

2023-10-08 0条评论 902点热度 0人点赞 admin 阅读全文

vue2项目中的路由页面,希望可以为每个页面设置不同的标题(title),就是显示在浏览器或微信中的标题。 总结以下的2种方式: 方式1,router/index.js 中增加如下代码: import Vue from 'vue'; const DEFAULT_TITLE = '这是个默认的标题'; router.beforeEach((to, from) => { Vue.nextTick(() => { document.title = to.meta.title || DEFAULT_TITLE;…

2023-09-17 0条评论 233点热度 0人点赞 admin 阅读全文

vue的项目,运行run serve的时候,控制台没有报错,但是打开首页,显示: Cannot GET / 网上知道有这几种解决方案,整理下,供参考: 打包的时候会把config文件夹下index.js的assetsPublicPath改成了 "./“ ,再次编译 npm run dev 却没有改回来 ,去掉 . 改成/就可以  把项目下的node_modules文件夹删除,然后重新npm install

2023-09-03 0条评论 614点热度 0人点赞 admin 阅读全文

ElementPlus/Vue3项目启动时候,遇到如下错误: error in ./src/i18n/index.ts Module not found: Error: Package path ./lib/locale/lang/zh-cn is not exported from package /path/to/project/node_modules/element-plus (see exports field in /path/to/project/node_modules/element-plus/p…

2023-08-28 0条评论 1165点热度 1人点赞 admin 阅读全文
1234555