feat: 修改多次绑定on事件
This commit is contained in:
@@ -38,10 +38,14 @@ const myDialogRef = ref(null)
|
||||
const ruleFormRef = ref(null)
|
||||
onMounted(() => {
|
||||
getList()
|
||||
eventBus.on('search', (res) => {
|
||||
getList(res)
|
||||
})
|
||||
})
|
||||
eventBus.on('search', (res) => {
|
||||
getList(res)
|
||||
onBeforeUnmount(() => {
|
||||
eventBus.off('search')
|
||||
})
|
||||
|
||||
async function getList(data = {}) {
|
||||
const res = await API.getPage({ page: datas.pagingConfig.pageNumber, size: datas.pagingConfig.pageSize, ...data })
|
||||
datas.tableData = res.records
|
||||
|
||||
@@ -98,9 +98,8 @@ const ruleFormRef = ref(null)
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
eventBus.on('search', (res) => {
|
||||
getList(res)
|
||||
})
|
||||
|
||||
|
||||
async function getList(data = {}) {
|
||||
const res = await API.getPage({ page: datas.pagingConfig.pageNumber, size: datas.pagingConfig.pageSize, ...data })
|
||||
datas.tableData = res.records
|
||||
|
||||
@@ -56,9 +56,12 @@ const myDialogRef = ref(null)
|
||||
const ruleFormRef = ref(null)
|
||||
onMounted(() => {
|
||||
getList()
|
||||
eventBus.on('search', (res) => {
|
||||
getList(res)
|
||||
})
|
||||
})
|
||||
eventBus.on('search', (res) => {
|
||||
getList(res)
|
||||
onBeforeUnmount(() => {
|
||||
eventBus.off('search')
|
||||
})
|
||||
async function getList(data = {}) {
|
||||
const res = await API.getPage({ page: datas.pagingConfig.pageNumber, size: datas.pagingConfig.pageSize, ...data })
|
||||
|
||||
@@ -84,6 +84,12 @@ const myDialogRef = ref(null)
|
||||
const ruleFormRef = ref(null)
|
||||
onMounted(() => {
|
||||
getList()
|
||||
eventBus.on('search', (res) => {
|
||||
getList(res)
|
||||
})
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
eventBus.off('search')
|
||||
})
|
||||
eventBus.on('search', (res) => {
|
||||
getList(res)
|
||||
|
||||
Reference in New Issue
Block a user