params' default value
This commit is contained in:
parent
403ea01769
commit
1520ecfcf6
|
@ -16,6 +16,7 @@ const initialState = {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function appReducer(state = initialState, action) {
|
export default function appReducer(state = initialState, action) {
|
||||||
|
console.log(state.paramValue)
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case actionTypes.GENERATE_QR_INFO: {
|
case actionTypes.GENERATE_QR_INFO: {
|
||||||
let text = action.text;
|
let text = action.text;
|
||||||
|
@ -53,7 +54,13 @@ export default function appReducer(state = initialState, action) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const newItem = item.slice();
|
const newItem = item.slice();
|
||||||
newItem[action.paramIndex] = isNaN(action.value) ? action.value : parseInt(action.value);
|
let newValue = action.value;
|
||||||
|
if (newValue.length <= 0)
|
||||||
|
newValue = state.paramInfo[action.rendererIndex][action.paramIndex].default;
|
||||||
|
console.log(newValue)
|
||||||
|
|
||||||
|
if (!isNaN(newValue)) newValue = parseInt(newValue);
|
||||||
|
newItem[action.paramIndex] = newValue;
|
||||||
return newItem;
|
return newItem;
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue