-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coding Standard #6
Labels
Comments
#1.
After:
#2.
After:
#3 #6 #7 #8 |
|
I don't understand 4. |
Take a look at this: https://github.com/eslint/eslint |
|
/* eslint-disable no-new */
new Vue({
el: '#app',
render: h => h(App)
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sử dụng computed để tính toán 1 property khi không cần tham số tại các line sau:
https://github.com/hamzoni/Web-Front-End-Assignment/blob/master/src/components/partials/ImageBox.vue#L42
https://github.com/hamzoni/Web-Front-End-Assignment/blob/master/src/components/partials/ImageBox.vue#L43
...
Sử dụng Array.prototype.map() trong những trường hợp for và không cần dùng đến index:
Tham khảo:
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/map
VD:
https://github.com/hamzoni/Web-Front-End-Assignment/blob/master/src/components/partials/Pagination.vue#L75
Viết lại như sau:
Ngoài ra chỗ này localPag em có thể sử dụng là result của cái map kia luôn. (Tùy thuộc vào logic)
VD:
https://github.com/hamzoni/Web-Front-End-Assignment/blob/master/src/components/partials/Pagination.vue#L22
Chỉ cần sử dụng !x là được.
VD:
https://github.com/hamzoni/Web-Front-End-Assignment/blob/master/src/components/pages/Albumn.vue#L69
Nên sử dụng hàm
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/push
Tên biến nhiều chỗ chưa Camel Case.
https://github.com/hamzoni/Web-Front-End-Assignment/blob/master/src/components/IHeader.vue#L20
Không commit key, password, ... lên git.
Sử dụng biến config để load ra key, password ở đây
https://github.com/hamzoni/Web-Front-End-Assignment/blob/master/src/assets/js/api.js#L4
The text was updated successfully, but these errors were encountered: