<template>
  <div style="background: #fff">123</div>
</template>

<script>
import { useModel } from '@/store'
import { onMounted } from 'vue'

export default {
  setup() {
    const {
      setPageTitle,
      setBack,
      setClick,
      setActions,
    } = useModel('pageHeader')

    const actions = [
      {
        icon: 'el-icon-plus',
        text: '增加',
        type: 'primary'
      },
      {
        text: '删除',
        type: 'warn'
      }
    ]

    const handleActionClick = index => {
      alert(index)
    }

    onMounted(() => {
      setPageTitle('abcd')
      setBack(true)
      setActions(actions)
      setClick(handleActionClick)
    })

  }
}
</script>
