index.js 588 B

1234567891011121314151617181920212223242526272829
  1. import PswSetting from './index.vue'
  2. import i18n from '@/util/lang/lang'
  3. PswSetting.install = function (Vue, store) {
  4. const Constructor = Vue.extend(PswSetting)
  5. let instance
  6. Vue.prototype.$pswSetting = () => {
  7. if (instance) {
  8. document.body.removeChild(instance.$el)
  9. instance = null
  10. }
  11. instance = new Constructor({
  12. el: document.createElement('div'),
  13. computed: {
  14. $store () { return store }
  15. },
  16. i18n,
  17. data () {
  18. return {}
  19. }
  20. })
  21. document.body.appendChild(instance.$el)
  22. }
  23. }
  24. export default PswSetting