public.js
867 Bytes
import { getForm } from "../flowform";
import { getHomeNoticeList } from "@/api/user.js"
export default {
data () {
return {
noticeList: [],
}
},
created () {
getHomeNoticeList().then(res => {
if (res.result) {
this.noticeList = res.result.noticeList
}
})
},
methods: {
//右侧表单选项卡事件
beforeLeave (activeName, oldActiveName) {
if (activeName && activeName != 0) this.getFromRouter(activeName)
},
//切换选项卡内容组件
getFromRouter (tabname) {
//根据tabname获取选中的表单
for(let item of this.tabList){
if(item.value === tabname){
this.currentSelectTab = item
break;
}
}
console.log(this.currentSelectTab);
this.componentTag = getForm(tabname, this.$route.query.sqywbm);
}
}
}