https://github.com/akoidan/vue-tricks
https://github.com/akoidan/vue-tricks
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/akoidan/vue-tricks
- Owner: akoidan
- Created: 2017-07-20T15:56:08.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-08-21T20:20:43.000Z (over 1 year ago)
- Last Synced: 2025-01-26T14:29:00.383Z (3 months ago)
- Language: HTML
- Size: 365 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vue-tricks
Advantages over reactjs:
- Cleaner code (separetion between logic and view)
- Code is intuitive
- Handling state in react could be really a pain in the ass: https://stackoverflow.com/questions/46185343/react-rerenders-whole-component-when-its-properties-change
- Vue automatically updates input state, no need to overhead code with " {
dispatch(exportModalVisibility(true));
}
}
6) import {exportGradebook, exportSurveyModal} from "../actions";
7) connect(mapStateToProps, {exportSurveyModal})(ExportButton);
8) this.props.exportSurveyModal()
9) reducers:
const exportSurveyModalShown = (state=false, action) => {
switch (action.type) {
case EXPORT_MODAL_VISIBILITY:
return action.data;
default:
return state;
}
};10) reducers const uiState = combineReducers({setupWizardShown, exportModalShown, switchDashboardEnabled, exportSurveyModalShown});
11) combineReducers ({..., uiState})