Fix occasion of mounted event of plugins system

This commit is contained in:
Pig Fang 2019-07-02 17:39:41 +08:00
parent 8fa8c6173e
commit f93e0d1755
22 changed files with 75 additions and 4 deletions

View File

@ -0,0 +1,8 @@
import Vue from 'vue'
import * as emitter from '../../scripts/event'
export default Vue.extend({
mounted() {
emitter.emit('mounted', { el: this.$root.$options.el })
},
})

View File

@ -1,7 +1,6 @@
import Vue from 'vue'
import loadI18n from './scripts/i18n-text'
import './scripts'
import * as emitter from './scripts/event'
import routes from './scripts/route'
Vue.config.productionTip = false
@ -22,9 +21,6 @@ function loadModules() {
// eslint-disable-next-line no-new
new Vue({
el: route.el,
mounted() {
this.$nextTick(() => emitter.emit('mounted', { el: route.el }))
},
render: h => h(route.component),
})
}

View File

@ -86,6 +86,7 @@ import { VueGoodTable } from 'vue-good-table'
import 'vue-good-table/dist/vue-good-table.min.css'
import enablePlugin from '../../components/mixins/enablePlugin'
import tableOptions from '../../components/mixins/tableOptions'
import emitMounted from '../../components/mixins/emitMounted'
export default {
name: 'Market',
@ -93,6 +94,7 @@ export default {
VueGoodTable,
},
mixins: [
emitMounted,
enablePlugin,
tableOptions,
],

View File

@ -116,6 +116,7 @@ import { VueGoodTable } from 'vue-good-table'
import 'vue-good-table/dist/vue-good-table.min.css'
import tableOptions from '../../components/mixins/tableOptions'
import serverTable from '../../components/mixins/serverTable'
import emitMounted from '../../components/mixins/emitMounted'
export default {
name: 'PlayersManagement',
@ -123,6 +124,7 @@ export default {
VueGoodTable,
},
mixins: [
emitMounted,
tableOptions,
serverTable,
],

View File

@ -79,6 +79,7 @@ import { VueGoodTable } from 'vue-good-table'
import 'vue-good-table/dist/vue-good-table.min.css'
import enablePlugin from '../../components/mixins/enablePlugin'
import tableOptions from '../../components/mixins/tableOptions'
import emitMounted from '../../components/mixins/emitMounted'
export default {
name: 'Plugins',
@ -86,6 +87,7 @@ export default {
VueGoodTable,
},
mixins: [
emitMounted,
enablePlugin,
tableOptions,
],

View File

@ -51,6 +51,7 @@ import { VueGoodTable } from 'vue-good-table'
import 'vue-good-table/dist/vue-good-table.min.css'
import tableOptions from '../../components/mixins/tableOptions'
import serverTable from '../../components/mixins/serverTable'
import emitMounted from '../../components/mixins/emitMounted'
export default {
name: 'ReportsManagement',
@ -58,6 +59,7 @@ export default {
VueGoodTable,
},
mixins: [
emitMounted,
tableOptions,
serverTable,
],

View File

@ -42,10 +42,15 @@
</template>
<script>
import emitMounted from '../../components/mixins/emitMounted'
const POLLING_INTERVAL = 500
export default {
name: 'UpdateButton',
mixins: [
emitMounted,
],
data: () => ({
canUpdate: blessing.extra.canUpdate,
updating: false,

View File

@ -92,6 +92,7 @@ import 'vue-good-table/dist/vue-good-table.min.css'
import { trans } from '../../scripts/i18n'
import tableOptions from '../../components/mixins/tableOptions'
import serverTable from '../../components/mixins/serverTable'
import emitMounted from '../../components/mixins/emitMounted'
export default {
name: 'UsersManagement',
@ -118,6 +119,7 @@ export default {
},
},
mixins: [
emitMounted,
tableOptions,
serverTable,
],

View File

@ -40,12 +40,16 @@
<script>
import Captcha from '../../components/Captcha.vue'
import emitMounted from '../../components/mixins/emitMounted'
export default {
name: 'Forgot',
components: {
Captcha,
},
mixins: [
emitMounted,
],
props: {
baseUrl: {
type: String,

View File

@ -54,12 +54,16 @@
<script>
import Captcha from '../../components/Captcha.vue'
import emitMounted from '../../components/mixins/emitMounted'
export default {
name: 'Login',
components: {
Captcha,
},
mixins: [
emitMounted,
],
props: {
baseUrl: {
type: String,

View File

@ -92,12 +92,16 @@
<script>
import Captcha from '../../components/Captcha.vue'
import emitMounted from '../../components/mixins/emitMounted'
export default {
name: 'Register',
components: {
Captcha,
},
mixins: [
emitMounted,
],
props: {
baseUrl: {
type: String,

View File

@ -44,8 +44,13 @@
</template>
<script>
import emitMounted from '../../components/mixins/emitMounted'
export default {
name: 'Reset',
mixins: [
emitMounted,
],
data() {
return {
uid: +this.$route[1],

View File

@ -120,6 +120,7 @@ import {
} from 'element-ui'
import { queryString, queryStringify } from '../../scripts/utils'
import SkinLibItem from '../../components/SkinLibItem.vue'
import emitMounted from '../../components/mixins/emitMounted'
Vue.use(ButtonGroup)
Vue.use(Select)
@ -131,6 +132,9 @@ export default {
Paginate,
SkinLibItem,
},
mixins: [
emitMounted,
],
data() {
return {
filter: queryString('filter', 'skin'),

View File

@ -167,6 +167,7 @@
import setAsAvatar from '../../components/mixins/setAsAvatar'
import addClosetItem from '../../components/mixins/addClosetItem'
import removeClosetItem from '../../components/mixins/removeClosetItem'
import emitMounted from '../../components/mixins/emitMounted'
import ApplyToPlayerDialog from '../../components/ApplyToPlayerDialog.vue'
export default {
@ -176,6 +177,7 @@ export default {
Previewer: () => import('../../components/Previewer.vue'),
},
mixins: [
emitMounted,
addClosetItem,
removeClosetItem,
setAsAvatar,

View File

@ -103,6 +103,7 @@ import Vue from 'vue'
import FileUpload from 'vue-upload-component'
import { isSlimSkin } from 'skinview3d'
import { Radio } from 'element-ui'
import emitMounted from '../../components/mixins/emitMounted'
Vue.use(Radio)
@ -112,6 +113,9 @@ export default {
Previewer: () => import('../../components/Previewer.vue'),
FileUpload,
},
mixins: [
emitMounted,
],
data() {
return {
name: '',

View File

@ -34,8 +34,13 @@
</template>
<script>
import emitMounted from '../../components/mixins/emitMounted'
export default {
name: 'BindPlayer',
mixins: [
emitMounted,
],
data() {
return {
players: [],

View File

@ -166,6 +166,7 @@ import ClosetItem from '../../components/ClosetItem.vue'
import EmailVerification from '../../components/EmailVerification.vue'
import AddPlayerDialog from '../../components/AddPlayerDialog.vue'
import ApplyToPlayerDialog from '../../components/ApplyToPlayerDialog.vue'
import emitMounted from '../../components/mixins/emitMounted'
export default {
name: 'Closet',
@ -177,6 +178,9 @@ export default {
AddPlayerDialog,
ApplyToPlayerDialog,
},
mixins: [
emitMounted,
],
props: {
baseUrl: {
type: String,

View File

@ -99,6 +99,7 @@ import Vue from 'vue'
import { Progress } from 'element-ui'
import Tween from '@tweenjs/tween.js'
import EmailVerification from '../../components/EmailVerification.vue'
import emitMounted from '../../components/mixins/emitMounted'
Vue.use(Progress)
@ -109,6 +110,9 @@ export default {
components: {
EmailVerification,
},
mixins: [
emitMounted,
],
data: () => ({
score: 0,
tweenedScore: 0,

View File

@ -102,6 +102,7 @@
import { VueGoodTable } from 'vue-good-table'
import 'vue-good-table/dist/vue-good-table.min.css'
import tableOptions from '../../components/mixins/tableOptions'
import emitMounted from '../../components/mixins/emitMounted'
import { walkFetch, init } from '../../scripts/net'
export default {
@ -110,6 +111,7 @@ export default {
VueGoodTable,
},
mixins: [
emitMounted,
tableOptions,
],
data() {

View File

@ -161,6 +161,7 @@
<script>
import AddPlayerDialog from '../../components/AddPlayerDialog.vue'
import emitMounted from '../../components/mixins/emitMounted'
export default {
name: 'Players',
@ -168,6 +169,9 @@ export default {
AddPlayerDialog,
Previewer: () => import('../../components/Previewer.vue'),
},
mixins: [
emitMounted,
],
props: {
baseUrl: {
type: String,

View File

@ -190,12 +190,16 @@
<script>
import EmailVerification from '../../components/EmailVerification.vue'
import emitMounted from '../../components/mixins/emitMounted'
export default {
name: 'Profile',
components: {
EmailVerification,
},
mixins: [
emitMounted,
],
data: () => ({
oldPassword: '',
newPassword: '',

View File

@ -29,6 +29,7 @@
import { VueGoodTable } from 'vue-good-table'
import 'vue-good-table/dist/vue-good-table.min.css'
import tableOptions from '../../components/mixins/tableOptions'
import emitMounted from '../../components/mixins/emitMounted'
export default {
name: 'MyReports',
@ -36,6 +37,7 @@ export default {
VueGoodTable,
},
mixins: [
emitMounted,
tableOptions,
],
props: {