2.5dev (#81)
* 同一界面内,多CRUD共存 * 解决多crud,对inject修改造成注入混乱,弃用Vue注入方式 * 自定义数据id字段名 * 以$options.cruds()方式实例化crud,避免多组件实例共享crud
This commit is contained in:
@@ -209,13 +209,14 @@ import { mapGetters } from 'vuex'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
let userRoles = []
|
||||
// crud交由presenter持有
|
||||
const defaultCrud = CRUD({ title: '用户', url: 'api/users', crudMethod: { ...crudUser }})
|
||||
const defaultForm = { id: null, username: null, nickName: null, sex: '男', email: null, enabled: 'false', roles: [], job: { id: null }, dept: { id: null }, phone: null }
|
||||
export default {
|
||||
name: 'User',
|
||||
components: { Treeselect, crudOperation, rrOperation, udOperation, pagination },
|
||||
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '用户', url: 'api/users', crudMethod: { ...crudUser }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
// 数据字典
|
||||
dicts: ['user_status'],
|
||||
data() {
|
||||
|
||||
Reference in New Issue
Block a user