1.效果图
2.代码
点击刷新按钮回调
refresh-change
方法
<template>
<div id="my-component">
<avue-crud :data="data" :option="option" @refresh-change="refreshChange"></avue-crud>
</div>
</template>
<script>
export default {
name: 'MyComponent',
data() {
return {
data: [
{
id: 1,
name: '张三',
sex: '男'
}, {
id: 2,
name: '李四',
sex: '女'
}
],
option: {
addBtn:false,
menu:false,
column: [
{
label: '姓名',
prop: 'name'
}, {
label: '性别',
prop: 'sex'
}
]
},
};
},
methods: {
refreshChange(){
this.$message.success('刷新回调');
}
}
};
</script>
<style lang="scss" scoped>
#my-component {
}
</style>