src/Admin/UI/module-admin/src/views/menu/components/edit/index.vue

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<template>
  <nm-dialog v-bind="dialog" @open="onOpen" :visible.sync="visible_">
    <node-menu ref="node" v-if="model.type === 0" :model="model" :parent="parent" v-on="on" />
    <route-menu ref="route" v-else-if="model.type === 1" :model="model" :parent="parent" v-on="on" />
    <link-menu ref="link" v-else :model="model" :parent="parent" v-on="on" />
    <template v-slot:footer>
      <nm-button text="保存" type="success" @click="onSubmit" />
      <nm-button text="重置" type="info" @click="onReset" />
    </template>
  </nm-dialog>
</template>
<script>
import { mixins } from 'netmodular-ui'
import NodeMenu from './components/node'
import RouteMenu from './components/route'
import LinkMenu from './components/link'

const api = $api.admin.menu

export default {
  mixins: [mixins.dialog],
  components: { NodeMenu, RouteMenu, LinkMenu },
  data() {
    return {
      model: {
        type: 0
      },
      dialog: {
        footer: true,
        title: '编辑菜单',
        icon: 'add',
        width: '60%',
        class: 'nm-admin-menu-edit',
        loading: false,
        draggable: true
      },
      on: {
        success: this.onSuccess,
        error: this.onError,
        'validate-error': this.onValidateError
      }
    }
  },
  props: ['parent', 'id'],
  methods: {
    async edit() {
      if (this.id === '') {
        this._warning('请选择要编辑的菜单~')
        return
      }

      this.dialog.loading = true
      this.model = await api.edit(this.id)
      this.setModel()
      this.dialog.loading = false
    },
    onOpen() {
      this.edit()
    },
    onSubmit() {
后面还有 35 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。