-- 创建行数缓存表
CREATE TABLE table_row_count (table_name VARCHAR(255) PRIMARY KEY,row_count INT
);-- 初始化行数
INSERT INTO table_row_count (table_name, row_count)
VALUES ('your_table_name', (SELECT COUNT(*) FROM your_table_name));-- 创建插入触发器
CREATE TRIGGER after_insert_trigger
AFTER INSERT ON your_table_name
FOR EACH ROW
BEGINUPDATE table_row_count SET row_count = row_count + 1 WHERE table_name = 'your_table_name';
END;-- 创建删除触发器
CREATE TRIGGER after_delete_trigger
AFTER DELETE ON your_table_name
FOR EACH ROW
BEGINUPDATE table_row_count SET row_count = row_count - 1 WHERE table_name = 'your_table_name';
END;-- 查询行数
SELECT row_count
FROM table_row_count
WHERE table_name = 'your_table_name';
最近刚进行 Vue3 Element plus 项目实践,在进行表单二次封装的时候,表单元素 select 下拉框组件选中一个选项后显示的是 value 而不是 label,下面上代码:
原来的写法:
<el-selectv-if"v.type select"…