// твоя библиотека(plugin)
import defaultOptions from './defaultOptions';
export default {
install: (app, options = defaultOptions) => {
// ок, мы не регаем глобально компоненты и тп, но мы регаем конфиг
app.config.globalProperties.$myPluginConfig = options;
}
}
const iconsBasePath = 'public';
computed: {
iconsPath() {
return this.$myPluginConfig.iconsPath || iconsBasePath;
},
},
window.$myPluginConfig = {}
const defineConfig = (options) => {
window.$myPluginConfig = options;
};
defineConfig({
iconsPath: 'public/icons'
})
appInstances.forEach((appInstance)=>{
// так оба экземпляра один стор юзают - нет, экземпляр не один, на каждую итерацию цикла создается инстанс стора
const store = new Vuex.Store({
modules: { thisStore } // а вот здесь у тебя ссылка на один и тот же объект, а не новый объект
});
new Vue({
el: `#thisApp_${ appInstance.dataset.id}`,
store,
components: { App },
});
});
const f = (a,b) => a+b;
const obj1 = { f };
const obj2 = Object.assign({}, obj1);
let a = {
};
a = String(a);
console.log(typeof a); // string