vue-chrome-extension-template
vue-chrome-extension-template copied to clipboard
How to generate Vue in content.js?
I want to generate from a Vue file in content.js and put the contents into the current tab, not in the popup or options html? Is it possible?
Yes
Hello ! Could you provide details on how to achieve this ? Thanks ! :)
@yzqiang @midm Here you go:
import Vue from 'vue';
Vue.config.productionTip = false
import component from './component.vue';
var my_element = document.createElement('div')
my_element.setAttribute('id', 'custom-plugin-identifier');
document.body.appendChild(my_element);
new Vue({
el: '#custom-plugin-identifier',
store,
render: h => h(component)
});