2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-04 06:32:23 +03:00
Files
Jeff Sagal 83e59241fe Vuepress 1.0 (#843)
* bump vuepress

* extend default-theme, implement codefund
2019-04-18 11:49:01 -05:00

44 lines
1.1 KiB
Vue

<script>
export default {
render (h) {
return h('div', {attrs: {id: 'codefund'}});
},
mounted () {
this.load();
},
watch: {
'$route' (to, from) {
if (
to.path !== from.path
// Only reload if the ad has been loaded
// otherwise it's possible that the script is appended but
// the ads are not loaded yet. This would result in duplicated ads.
&& this.$el.querySelector('#cf')
) {
this.$el.innerHTML = '';
this.load();
}
},
},
methods: {
load () {
// const template = 'default';
// const template = 'vertical';
// const template = 'float-with-close';
// const template = 'image-only';
// const template = 'image-centered';
// const template = 'square';
const template = 'centered';
// const template = 'bottom-bar';
const s = document.createElement('script');
s.id = '_codefund_js';
s.src = `//codefund.app/properties/193/funder.js?template=${template}`;
s.async = 'async';
this.$el.appendChild(s);
},
},
};
</script>