How to use d2-crud-plus - 10 common examples

To help you get started, we’ve selected a few d2-crud-plus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github greper / d2-crud-plus / packages / d2-crud-plus-example / src / business / lib / index.js View on Github external
qiniu: {
    bucket: 'd2p-demo',
    getToken (custom) {
      return request({
        url: '/upload/qiniu/getToken',
        method: 'get'
      }).then(ret => {
        return ret.data // {token:xxx,expires:xxx}
      })
    },
    domain: 'http://d2p.file.veryreader.com'
  }
})

//  自定义字段类型示例
d2CrudPlus.util.columnResolve.addTypes({
  'time2': {
    form: { component: { name: 'el-date-picker', props: { type: 'datetime' } } }, // 编辑时支持日期时间
    search: { component: { props: { type: 'date' } } }, // 搜索时只支持日期
    formatter (row, column, value, index) {
      return value + '-->我是自定义字段类型:time2'
    },
    _handle (column) {
      //  此方法主要将column中某些依赖的用户配置的属性放到默认配置中,比如数据字典的配置
      if (column.dict != null) {
        this.form.component.props.dict = column.dict
        this.component.props.dict = column.dict
      }
    }
  }
})
github greper / d2-crud-plus / packages / d2-crud-plus-example / src / business / views / hotel / dashboard / index.vue View on Github external
created () {
    d2CrudPlus.util.dict.get(this.roomTypeDict).then((data) => {
      this.roomTypes = data
    })
    d2CrudPlus.util.dict.get(this.roomStatusDict).then((data) => {
      console.log('roomStatusDict:', data)
      for (let item of data) {
        this.roomStatuses[item.value] = item
      }
      this.$set(this.roomStatusDict, 'data', data)
      this.loadData()
    })
  },
  methods: {
github greper / d2-crud-plus / packages / d2-crud-plus-example / src / business / views / hotel / dashboard / index.vue View on Github external
created () {
    d2CrudPlus.util.dict.get(this.roomTypeDict).then((data) => {
      this.roomTypes = data
    })
    d2CrudPlus.util.dict.get(this.roomStatusDict).then((data) => {
      console.log('roomStatusDict:', data)
      for (let item of data) {
        this.roomStatuses[item.value] = item
      }
      this.$set(this.roomStatusDict, 'data', data)
      this.loadData()
    })
  },
  methods: {

d2-crud-plus

d2-admin的d2-crud的扩展

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis