Skip to content

Commit 9790248

Browse files
committed
Deprecate on:load event, use on:ready instead
1 parent 3a25fd7 commit 9790248

File tree

4 files changed

+9
-33
lines changed

4 files changed

+9
-33
lines changed

README.md

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ Next, you'll need to import the Email Editor component to your app.
4242
<button v-on:click="exportHtml">Export HTML</button>
4343
</div>
4444

45-
<EmailEditor
46-
ref="emailEditor"
47-
v-on:load="editorLoaded"
48-
v-on:ready="editorReady"
49-
/>
45+
<EmailEditor ref="emailEditor" v-on:ready="editorReady" />
5046
</div>
5147
</div>
5248
</template>
@@ -60,15 +56,10 @@ Next, you'll need to import the Email Editor component to your app.
6056
EmailEditor,
6157
},
6258
methods: {
63-
// called when the editor is created
64-
editorLoaded() {
65-
console.log('editorLoaded');
66-
// Pass the template JSON here
67-
// this.$refs.emailEditor.editor.loadDesign({});
68-
},
69-
// called when the editor has finished loading all custom css/js/fonts
7059
editorReady() {
7160
console.log('editorReady');
61+
// Pass the template JSON here
62+
// this.$refs.emailEditor.editor.loadDesign({});
7263
},
7364
saveDesign() {
7465
this.$refs.emailEditor.editor.saveDesign((design) => {
@@ -130,7 +121,6 @@ Here's an example using the above properties...
130121
:tools="tools"
131122
:options="options"
132123
ref="emailEditor"
133-
v-on:load="editorLoaded"
134124
v-on:ready="editorReady"
135125
/>
136126
</div>
@@ -168,15 +158,10 @@ Here's an example using the above properties...
168158
};
169159
},
170160
methods: {
171-
// called when the editor is created
172-
editorLoaded() {
173-
console.log('editorLoaded');
174-
// Pass your template JSON here
175-
// this.$refs.emailEditor.editor.loadDesign({});
176-
},
177-
// called when the editor has finished loading all custom css/js/fonts
178161
editorReady() {
179162
console.log('editorReady');
163+
// Pass your template JSON here
164+
// this.$refs.emailEditor.editor.loadDesign({});
180165
},
181166
saveDesign() {
182167
this.$refs.emailEditor.editor.saveDesign((design) => {

src/components/EmailEditor.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default {
6565
},
6666
});
6767
68+
// @deprecated
6869
this.$emit('load');
6970
7071
this.editor.addEventListener('editor:ready', () => {

src/views/DesignEdit.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<button v-on:click="exportHtml">Export HTML</button>
1010
</div>
1111

12-
<EmailEditor ref="emailEditor" v-on:load="editorLoaded" v-on:ready="editorReady" />
12+
<EmailEditor ref="emailEditor" v-on:ready="editorReady" />
1313
</div>
1414
</div>
1515
</template>
@@ -23,11 +23,6 @@ export default {
2323
EmailEditor
2424
},
2525
methods: {
26-
// called when the editor is created
27-
editorLoaded() {
28-
console.log('editorLoaded');
29-
},
30-
// called when the editor has finished loading all custom css/js/fonts
3126
editorReady() {
3227
console.log('editorReady');
3328
},

src/views/Example.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<button v-on:click="exportHtml">Export HTML</button>
99
</div>
1010

11-
<EmailEditor ref="emailEditor" v-on:load="editorLoaded" v-on:ready="editorReady" />
11+
<EmailEditor ref="emailEditor" v-on:ready="editorReady" />
1212
</div>
1313
</div>
1414
</template>
@@ -23,14 +23,9 @@ export default {
2323
EmailEditor
2424
},
2525
methods: {
26-
// called when the editor is created
27-
editorLoaded() {
28-
console.log('editorLoaded');
29-
this.$refs.emailEditor.editor.loadDesign(sample);
30-
},
31-
// called when the editor has finished loading all custom css/js/fonts
3226
editorReady() {
3327
console.log('editorReady');
28+
this.$refs.emailEditor.editor.loadDesign(sample);
3429
},
3530
saveDesign() {
3631
this.$refs.emailEditor.editor.saveDesign(

0 commit comments

Comments
 (0)