2022-10-07 11:09:16 -04:00
|
|
|
import Vue from 'vue';
|
|
|
|
import FormUrlApp from './components/form_url_app.vue';
|
|
|
|
|
|
|
|
export default () => {
|
|
|
|
const el = document.querySelector('.js-vue-webhook-form');
|
|
|
|
|
|
|
|
if (!el) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2022-10-18 17:09:37 -04:00
|
|
|
const { url: initialUrl, urlVariables } = el.dataset;
|
|
|
|
|
2022-10-07 11:09:16 -04:00
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
name: 'WebhookFormRoot',
|
|
|
|
render(createElement) {
|
2022-10-18 17:09:37 -04:00
|
|
|
return createElement(FormUrlApp, {
|
|
|
|
props: {
|
|
|
|
initialUrl,
|
2022-11-04 05:11:46 -04:00
|
|
|
initialUrlVariables: JSON.parse(urlVariables),
|
2022-10-18 17:09:37 -04:00
|
|
|
},
|
|
|
|
});
|
2022-10-07 11:09:16 -04:00
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|