menu.ts 598 Bytes
import { reactive, h } from 'vue'
import { renderIcon } from '@/utils'
import { MenuOption, MenuGroupOption } from 'naive-ui'
import { icon } from '@/plugins'

const { DevicesIcon } = icon.carbon

export const renderMenuLabel = (option: MenuOption | MenuGroupOption) => {
  return option.label
}

export const expandedKeys = () => 'three-project'

export const menuOptionsInit = () => {
  const t = window['$t']
  return reactive([
    {
      label: () => h('span', null, { default: () => t('project.three_project') }),
      key: 'three-project',
      icon: renderIcon(DevicesIcon)
    }
  ])
}