Is it possible for the Vue render function to receive a partial template from an external source?
If there is a render function like the one below:
var custom_form_modal = function ( context, custom_form ) {
context.$Modal.info({
render: (h) => {
return h('div', {})
}
})
...
where custem_form
looks something like this:
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="Name" prop="name">
<Input v-model="formValidate.name" placeholder="Enter your name"></Input>
</FormItem>
<FormItem label="E-mail" prop="mail">
<Input v-model="formValidate.mail" placeholder="Enter your e-mail"></Input>
</FormItem>
<FormItem label="City" prop="city">
<Select v-model="formValidate.city" placeholder="Select your city">
<Option value="beijing">New York</Option>
<Option value="shanghai">London</Option>
<Option value="shenzhen">Sydney</Option>
</Select>
</FormItem>
</Form>
or any other JavaScript-based form explanation.
I want to use this as the custom_form
, and then render it into the div
(as seen in the custom_form_modal
). Is there a way to achieve this?
EDIT-1
I want to render the template using the function custom_form_modal
, so that I can display the modal on a button click event without having to write code within the invoking vue file's <template>
. This is my requirement.