写一段mysql触发器代码 :mysql数据库 的runoob_tbl 表 的runoob_author字段变化时触发
时间: 2024-05-27 12:13:22 浏览: 104
的触发器,将变化后的值插入到另一个表runoob_log中的author字段中。
CREATE TRIGGER trigger_name
AFTER UPDATE ON runoob_tbl
FOR EACH ROW
BEGIN
IF NEW.runoob_author != OLD.runoob_author THEN
INSERT INTO runoob_log (author) VALUES (NEW.runoob_author);
END IF;
END;
相关问题
写一段mysql触发器代码 :mysql数据库 的runoob_tbl 表 的runoob_author字段变化时更改runoob_title字段的值等于runoob_author字段
好的,您的要求已经记录下来了。以下是mysql触发器代码:
delimiter $
create trigger trigger_name
before update on runoob_tbl
for each row
begin
if new.runoob_author <> old.runoob_author then
update runoob_tbl set runoob_title = new.runoob_author where runoob_author = old.runoob_author;
end if;
end;
$
请注意,这是一段样例代码,需要根据您的具体需求进行修改和适配。如果您需要更多的帮助,请随时告诉我。
vuefor循环el-tabs 并根据filteredTabs的数据源动态展示luckysheet表格 filteredTabs: [{ pid: 38, mdl_pid: 15, tbl_typ: "D", tbl_nam: "DIY_xka_dtl_1", tbl_cmt: "小可爱-明细表1", frm_cnf_pub: "json", lck_cnf_pub: "json", lck_mdl_cnf_pub: "json" }, { pid: 30, mdl_pid: 15, tbl_typ: "D", tbl_nam: "DIY_xka_dtl_2", tbl_cmt: "小可爱-明细表2", frm_cnf_pub: "json", lck_cnf_pub: "json", lck_mdl_cnf_pub: "json" } ],
你可以通过使用 `v-for` 指令循环 `filteredTabs` 数组,并在循环中创建 `el-tabs` 和 `luckysheet` 表格。具体实现代码如下:
```html
<template>
<el-tabs v-model="activeTab">
<el-tab-pane v-for="(tab, index) in filteredTabs" :key="index" :label="tab.tbl_cmt">
<luckysheet :pid="tab.pid" :mdl_pid="tab.mdl_pid" :tbl_typ="tab.tbl_typ" :tbl_nam="tab.tbl_nam" :frm_cnf_pub="tab.frm_cnf_pub" :lck_cnf_pub="tab.lck_cnf_pub" :lck_mdl_cnf_pub="tab.lck_mdl_cnf_pub"></luckysheet>
</el-tab-pane>
</el-tabs>
</template>
<script>
import Luckysheet from '@/components/Luckysheet.vue'
export default {
components: {
Luckysheet
},
data() {
return {
activeTab: '',
filteredTabs: [
{
pid: 38,
mdl_pid: 15,
tbl_typ: 'D',
tbl_nam: 'DIY_xka_dtl_1',
tbl_cmt: '小可爱-明细表1',
frm_cnf_pub: 'json',
lck_cnf_pub: 'json',
lck_mdl_cnf_pub: 'json'
},
{
pid: 30,
mdl_pid: 15,
tbl_typ: 'D',
tbl_nam: 'DIY_xka_dtl_2',
tbl_cmt: '小可爱-明细表2',
frm_cnf_pub: 'json',
lck_cnf_pub: 'json',
lck_mdl_cnf_pub: 'json'
}
]
}
}
}
</script>
```
在以上代码中,我们使用 `v-for` 指令循环 `filteredTabs` 数组,并在循环中创建 `el-tabs` 的 `el-tab-pane`,并将每个 `tab.tbl_cmt` 作为标签的显示文本。同时,在 `el-tab-pane` 中,我们将 `luckysheet` 组件作为子组件,并将 `tab` 对象中的属性传递给 `luckysheet` 组件作为参数,以实现动态展示不同的 `luckysheet` 表格。
阅读全文
相关推荐
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231044937.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)