<template>
  <div id="info">
    <data-form v-model="form" :fields="fields" @save="toSave"></data-form>
  </div>
</template>

<script>
import { fields } from './columns';
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'info',
  props: {
    form: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  model: {
    prop: 'form',
    event: 'change',
  },
  components: {},
  data: function () {
    return {
      fields: fields,
    };
  },
  created() {},
  methods: {
    toSave() {
      this.$emit('save', this.form);
    },
  },
  computed: {
    ...mapState(['user']),
    pageTitle() {
      return `${this.$route.meta.title}`;
    },
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
};
</script>

<style lang="less" scoped></style>
