| 12345678910111213141516171819202122232425262728293031323334 |
- import { Collection, Model } from 'js-abstract-model'
- class PageSetting extends Model {
- constructor (data) {
- super(data, [
- { key: 'id' },
- { key: 'key' },
- {
- key: 'value',
- default: {
- sections: [],
- layoutConfig: {},
- seo: {}
- }
- }
- ])
- if (typeof this.value === 'string') {
- this.value = JSON.parse(this.value)
- }
- }
- getStringifyValue () {
- return JSON.stringify(this.value)
- }
- }
- class PageSettingList extends Collection {
- model() {
- return PageSetting
- }
- }
- export { PageSetting, PageSettingList }
|