@afeefa/vue-app 0.0.59 → 0.0.60

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 0.0.59
1
+ 0.0.60
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.59",
3
+ "version": "0.0.60",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -151,9 +151,11 @@ export default class ARichTextArea extends Vue {
151
151
  },
152
152
  onFocus: ({ editor, event }) => {
153
153
  this.focus = true
154
+ this.$emit('focus')
154
155
  },
155
156
  onBlur: ({ editor, event }) => {
156
157
  this.focus = false
158
+ this.$emit('blur')
157
159
  }
158
160
  })
159
161
 
@@ -44,6 +44,8 @@ export default class EditForm extends Vue {
44
44
  }
45
45
 
46
46
  get changed () {
47
+ // console.log(this.json)
48
+ // console.log(this.lastJson)
47
49
  return this.json !== this.lastJson
48
50
  }
49
51
 
@@ -30,6 +30,7 @@
30
30
  <a-row class="mt-6">
31
31
  <v-btn
32
32
  :disabled="!changed || !valid"
33
+ color="green white--text"
33
34
  @click="save"
34
35
  >
35
36
  Anlegen
@@ -55,16 +56,15 @@ import { EditPageMixin } from './EditPageMixin'
55
56
  })
56
57
  export default class CreatePage extends Mixins(EditPageMixin) {
57
58
  created () {
58
- if (!this.$parent.constructor.createRouteConfig) {
59
+ if (!this.$parent.constructor.getCreateRouteConfig) {
59
60
  console.warn('<create-page> owner must provide a static createRouteConfig method.')
60
61
  }
61
62
 
62
63
  this.reset()
63
- this.$emit('model', this.modelToEdit)
64
64
  }
65
65
 
66
66
  get editConfig () {
67
- return this.$parent.constructor.createRouteConfig
67
+ return this.$parent.constructor.getCreateRouteConfig(this.$route)
68
68
  }
69
69
 
70
70
  get modelUpateAction () {
@@ -61,7 +61,13 @@ import { Component, Mixins, Watch } from '@a-vue'
61
61
  import { EditPageMixin } from './EditPageMixin'
62
62
 
63
63
  @Component({
64
- props: ['model', 'icon', 'title', 'listLink', 'getAction']
64
+ props: [
65
+ 'model',
66
+ 'icon',
67
+ 'title',
68
+ 'listLink',
69
+ 'getAction'
70
+ ]
65
71
  })
66
72
  export default class EditPage extends Mixins(EditPageMixin) {
67
73
  $hasOptions = ['detail', {list: false}]
@@ -78,7 +78,11 @@ export class EditPageMixin extends Vue {
78
78
  }
79
79
 
80
80
  reset () {
81
- this.modelToEdit = this.createModelToEdit()
81
+ const modelToEdit = this.createModelToEdit()
82
+ if (this.editConfig.createModelToEdit) {
83
+ this.editConfig.createModelToEdit(modelToEdit)
84
+ }
85
+ this.modelToEdit = modelToEdit // this assignment makes modelToEdit recursively reactive
82
86
  this.$emit('model', this.modelToEdit)
83
87
  }
84
88