Setup组合式用法

{}

暂无数据

<template>
  {{form}}
  <avue-crud ref="crudRef"
             v-model="form"
             :option="option"
             @row-save="rowSave"
             @row-update="rowUpdate"
             @row-del="rowDel"
             :data="data"></avue-crud>
</template>
<script setup>
import { ref, getCurrentInstance } from 'vue'
//获取this
let { proxy } = getCurrentInstance()
const option = ref(null)
const data = ref(null)
const form = ref({})
option.value = {
  index: true,
  column: [{
    label: '姓名',
    prop: 'name'
  }, {
    label: '年龄',
    prop: 'sex'
  }]
}
data.value = [{
  name: '张三',
  sex: 12
}, {
  name: '李四',
  sex: 13
}]
function rowSave (row, done, loading) {
  done(row)
}
function rowDel (row, index, done) {
  done(row)
}
function rowUpdate (row, index, done, loading) {
  done(row)
}
</script>
显示代码
Last Updated:
Contributors: smallwei
您正在浏览基于Avue 3.x文档; 点击这里 查看Avue 2.x 的文档