PostCategory.js 406 B

1234567891011121314151617181920212223
  1. import { Collection, Model } from 'js-abstract-model'
  2. class PostCategory extends Model {
  3. constructor (data) {
  4. super(data, [
  5. { key: 'id' },
  6. { key: 'title' },
  7. { key: 'parent' },
  8. {
  9. key: 'children',
  10. defalut: []
  11. }
  12. ])
  13. }
  14. }
  15. class PostCategoryList extends Collection {
  16. model () {
  17. return PostCategory
  18. }
  19. }
  20. export { PostCategory, PostCategoryList }