随笔分类 -  前端

摘要:utils/numberToChinese.js // 将四位数以内的数字转换为中文 function SectionToChinese(section) { const chnNumChar = [ '零', '一', '二', '三', '四', '五', '六', '七', '八', '九' 阅读全文
posted @ 2024-12-02 17:09 .Tik 阅读(20) 评论(0) 推荐(0) 编辑
摘要:问题:表格数据return的时候文字过长导致悬浮框偏移到表格其他列上去了 <div style="width: 100px;" data-toggle="tooltip" data-placement="top" title="${displayValue}"> ${ displayValue }< 阅读全文
posted @ 2024-11-14 17:46 .Tik 阅读(78) 评论(0) 推荐(0) 编辑
摘要:1、在utils文件夹下创建中间件middle.js // 中间件 实现跨页面调用方法 import Vue from 'vue' export default new Vue 2、被调用页面代码 <template></template> <script> import Middle from ' 阅读全文
posted @ 2024-11-11 15:45 .Tik 阅读(51) 评论(0) 推荐(0) 编辑
摘要:后端返回时间为2024-11-07 09:51:12.48,带毫秒 formatDate(row, column, cellValue) { if (!cellValue) return ''; // 处理空值 const date = new Date(cellValue); // 将字符串转换为 阅读全文
posted @ 2024-11-07 10:08 .Tik 阅读(8) 评论(0) 推荐(0) 编辑
摘要:<el-card v-loading="loading" shadow="hover" element-loading-background="rgba(0, 0, 0, 0)" > 在data里定义loading变量,初始值为true。在请求后台的前面写loading=true,后面写loadin 阅读全文
posted @ 2024-11-04 15:39 .Tik 阅读(152) 评论(0) 推荐(0) 编辑
摘要:computed: { // 使用computed属性来返回昨天的日期 yesterdayDate() { // 获取当前时间 const now = new Date(); // 减去一天的毫秒数 const oneDayAgo = new Date(now - 24 * 60 * 60 * 10 阅读全文
posted @ 2024-07-29 11:11 .Tik 阅读(24) 评论(0) 推荐(0) 编辑
摘要:使用 Props 传递数据 父组件向子组件传递数据:父组件通过 props 将数据传递给子组件。在父组件的模板中,通过绑定属性的方式传递数据给子组件。 父组件示例 (ParentComponent.vue): <template> <div> <h1>父组件</h1> <!-- 使用子组件,并传递数 阅读全文
posted @ 2024-07-08 16:44 .Tik 阅读(42) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示