Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit 84797ae

Browse files
committed
dynamic component loading
1 parent 086c6af commit 84797ae

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

client/src/components/email.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<div class="email">
33
<div class="container">
44
<p style="text-align: center;margin-bottom: 10px; font-size: 40px; text-decoration: underline"><b> Customer Proof</b></p>
5-
<!-- {{formSchemaInstance.data}} -->
65
<schemasubform v-if="!flag" :schemainstance="formSchemaInstance"></schemasubform>
6+
<!-- <schemasubform v-if="!flag" :is="componentLoader"></schemasubform> -->
77
<div class="row" v-if="flag">
88
<div class="col-md-6">
99
<div class="form-group">
@@ -59,19 +59,20 @@
5959
</div>
6060
</template>
6161
<script>
62-
import Editor from '@tinymce/tinymce-vue'
6362
import sendmailModal from '@/api/sendmail'
6463
import config from '@/config'
6564
import schemaModel from '@/api/schema'
66-
import SchemaSubForm from './SchemaSubForm'
6765
/*eslint-disable*/
6866
export default {
6967
name: 'email',
7068
computed: {
69+
// componentLoader () {
70+
// return () => import('./${this.formSchemaInstance}')
71+
// }
7172
},
7273
components: {
73-
'editor': Editor,
74-
'schemasubform': SchemaSubForm
74+
'editor': function (resolve) { require(['@tinymce/tinymce-vue'], resolve)},
75+
'schemasubform': function (resolve) { require(['./SchemaSubForm'], resolve)}
7576
},
7677
props: {
7778
'btnArr': Object,

client/src/components/emailtemplate.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
</div>
77
<div class="editor" v-if="newTemplate">
88
<h2 class="heading">Create Template</h2>
9-
<editor v-model="GetHtmlOfEditor" api-key="ppzi01crrfo3pvd43s3do89pguwkhowrwajpjdqdkginzj7k" :toolbar="toolbar1" :plugins="plugins" :init="settings" :initial-value="gethtmlcontent"></editor>
9+
<keep-alive>
10+
<editor v-model="GetHtmlOfEditor" api-key="ppzi01crrfo3pvd43s3do89pguwkhowrwajpjdqdkginzj7k" :toolbar="toolbar1" :plugins="plugins" :init="settings" :initial-value="gethtmlcontent"></editor>
11+
</keep-alive>
1012
<Input v-model="templateName" placeholder="Enter Template name" style="width: 300px" class="dataEnter"/>
1113
<Button type="primary" @click="saveTemplate" class="dataEnter">Save Template</Button>
1214
</div>

0 commit comments

Comments
 (0)