ttk-app-core
Version:
@ttk/recat enterprise develop framework
28 lines (25 loc) • 500 B
JavaScript
import { Map, fromJS, List } from 'immutable'
// 表格数据
export function tableData(state = List(), action) {
switch (action.type) {
case 'update':
state = List(fromJS(action.data))
return state
default:
return state
}
}
// 表单数据
export function formData(state = fromJS({
name: '',
age: '',
adress: ''
}), action) {
switch (action.type) {
case 'update':
state = fromJS(action.data)
return state
default:
return state
}
}