Skip to content

Commit 9b43607

Browse files
committed
Revert "Deprecate on:load event, use on:ready instead"
This reverts commit 9790248.
1 parent 9790248 commit 9b43607

File tree

4 files changed

+33
-9
lines changed

4 files changed

+33
-9
lines changed

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ 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 ref="emailEditor" v-on:ready="editorReady" />
45+
<EmailEditor
46+
ref="emailEditor"
47+
v-on:load="editorLoaded"
48+
v-on:ready="editorReady"
49+
/>
4650
</div>
4751
</div>
4852
</template>
@@ -56,11 +60,16 @@ Next, you'll need to import the Email Editor component to your app.
5660
EmailEditor,
5761
},
5862
methods: {
59-
editorReady() {
60-
console.log('editorReady');
63+
// called when the editor is created
64+
editorLoaded() {
65+
console.log('editorLoaded');
6166
// Pass the template JSON here
6267
// this.$refs.emailEditor.editor.loadDesign({});
6368
},
69+
// called when the editor has finished loading
70+
editorReady() {
71+
console.log('editorReady');
72+
},
6473
saveDesign() {
6574
this.$refs.emailEditor.editor.saveDesign((design) => {
6675
console.log('saveDesign', design);
@@ -121,6 +130,7 @@ Here's an example using the above properties...
121130
:tools="tools"
122131
:options="options"
123132
ref="emailEditor"
133+
v-on:load="editorLoaded"
124134
v-on:ready="editorReady"
125135
/>
126136
</div>
@@ -158,11 +168,16 @@ Here's an example using the above properties...
158168
};
159169
},
160170
methods: {
161-
editorReady() {
162-
console.log('editorReady');
171+
// called when the editor is created
172+
editorLoaded() {
173+
console.log('editorLoaded');
163174
// Pass your template JSON here
164175
// this.$refs.emailEditor.editor.loadDesign({});
165176
},
177+
// called when the editor has finished loading
178+
editorReady() {
179+
console.log('editorReady');
180+
},
166181
saveDesign() {
167182
this.$refs.emailEditor.editor.saveDesign((design) => {
168183
console.log('saveDesign', design);

src/components/EmailEditor.vue

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

src/views/DesignEdit.vue

Lines changed: 6 additions & 1 deletion
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:ready="editorReady" />
12+
<EmailEditor ref="emailEditor" v-on:load="editorLoaded" v-on:ready="editorReady" />
1313
</div>
1414
</div>
1515
</template>
@@ -23,6 +23,11 @@ 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
2631
editorReady() {
2732
console.log('editorReady');
2833
},

src/views/Example.vue

Lines changed: 7 additions & 2 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:ready="editorReady" />
11+
<EmailEditor ref="emailEditor" v-on:load="editorLoaded" v-on:ready="editorReady" />
1212
</div>
1313
</div>
1414
</template>
@@ -23,9 +23,14 @@ 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
2632
editorReady() {
2733
console.log('editorReady');
28-
this.$refs.emailEditor.editor.loadDesign(sample);
2934
},
3035
saveDesign() {
3136
this.$refs.emailEditor.editor.saveDesign(

0 commit comments

Comments
 (0)