fix: remove unnecessary v-once directives from dynamic components (#1080)

This commit is contained in:
pa
2025-01-14 00:23:39 +09:00
committed by GitHub
parent 885ead4edf
commit dacc6a8637
16 changed files with 151 additions and 150 deletions
+19 -18
View File
@@ -51,7 +51,7 @@ mixin playerListTab()
div.photon-event-table(v-if="photonLoggingEnabled")
div(style="position:absolute;width:600px;margin-left:215px;z-index:1")
el-select(v-model="photonEventTableTypeFilter" @change="photonEventTableFilterChange" multiple clearable collapse-tags style="flex:1;width:220px" :placeholder="$t('view.player_list.photon.filter_placeholder')")
el-option(v-once v-for="type in photonEventTableTypeFilterList" :key="type" :label="type" :value="type")
el-option(v-for="type in photonEventTableTypeFilterList" :key="type" :label="type" :value="type")
el-input(v-model="photonEventTableFilter" @input="photonEventTableFilterChange" :placeholder="$t('view.player_list.photon.search_placeholder')" clearable style="width:150px;margin-left:10px")
el-button(@click="showChatboxBlacklistDialog" style="margin-left:10px") {{ $t('view.player_list.photon.chatbox_blacklist') }}
el-tooltip(placement="bottom" :content="$t('view.player_list.photon.status_tooltip')" :disabled="hideTooltips")
@@ -63,17 +63,17 @@ mixin playerListTab()
el-tab-pane(:label="$t('view.player_list.photon.current')")
data-tables(v-bind="photonEventTable" style="margin-bottom:10px")
el-table-column(:label="$t('table.playerList.date')" prop="created_at" width="120")
template(v-once #default="scope")
template(#default="scope")
el-tooltip(placement="right")
template(#content)
span {{ scope.row.created_at | formatDate('long') }}
span {{ scope.row.created_at | formatDate('short') }}
el-table-column(:label="$t('table.playerList.user')" prop="photonId" width="160")
template(v-once #default="scope")
template(#default="scope")
span.x-link(v-text="scope.row.displayName" @click="showUserFromPhotonId(scope.row.photonId)" style="padding-right:10px")
el-table-column(:label="$t('table.playerList.type')" prop="type" width="140")
el-table-column(:label="$t('table.playerList.detail')" prop="text")
template(v-once #default="scope")
template(#default="scope")
template(v-if="scope.row.type === 'ChangeAvatar'")
span.x-link(v-text="scope.row.avatar.name" @click="showAvatarDialog(scope.row.avatar.id)")
|  
@@ -134,17 +134,17 @@ mixin playerListTab()
el-tab-pane(:label="$t('view.player_list.photon.previous')")
data-tables(v-bind="photonEventTablePrevious" style="margin-bottom:10px")
el-table-column(:label="$t('table.playerList.date')" prop="created_at" width="120")
template(v-once #default="scope")
template(#default="scope")
el-tooltip(placement="right")
template(#content)
span {{ scope.row.created_at | formatDate('long') }}
span {{ scope.row.created_at | formatDate('short') }}
el-table-column(:label="$t('table.playerList.user')" prop="photonId" width="160")
template(v-once #default="scope")
template(#default="scope")
span.x-link(v-text="scope.row.displayName" @click="lookupUser(scope.row)" style="padding-right:10px")
el-table-column(:label="$t('table.playerList.type')" prop="type" width="140")
el-table-column(:label="$t('table.playerList.detail')" prop="text")
template(v-once #default="scope")
template(#default="scope")
template(v-if="scope.row.type === 'ChangeAvatar'")
span.x-link(v-text="scope.row.avatar.name" @click="showAvatarDialog(scope.row.avatar.id)")
|  
@@ -205,16 +205,16 @@ mixin playerListTab()
div.current-instance-table
data-tables(v-bind="currentInstanceUserList" @row-click="selectCurrentInstanceRow" style="margin-top:10px;cursor:pointer")
el-table-column(:label="$t('table.playerList.avatar')" width="70" prop="photo")
template(v-once #default="scope")
div(v-if="userImage(scope.row.ref)" style="display:flex;align-items:center;")
template(#default="scope")
template(v-if="userImage(scope.row.ref)")
el-popover(placement="right" height="500px" trigger="hover")
img.friends-list-avatar(slot="reference" v-lazy="userImage(scope.row.ref)")
img.friends-list-avatar(v-lazy="userImageFull(scope.row.ref)" style="height:500px;cursor:pointer" @click="showFullscreenImageDialog(userImageFull(scope.row.ref))")
el-table-column(:label="$t('table.playerList.timer')" width="80" prop="timer" sortable)
template(v-once #default="scope")
template(#default="scope")
timer(:epoch="scope.row.timer")
el-table-column(v-if="photonLoggingEnabled" :label="$t('table.playerList.photonId')" width="110" prop="photonId" sortable)
template(v-once #default="scope")
template(#default="scope")
template(v-if="chatboxUserBlacklist.has(scope.row.ref.id)")
el-tooltip(placement="left" content="Unblock chatbox messages")
el-button(type="text" icon="el-icon-turn-off-microphone" size="mini" style="color:red;margin-right:5px" @click.stop="deleteChatboxUserBlacklist(scope.row.ref.id)")
@@ -223,7 +223,7 @@ mixin playerListTab()
el-button(type="text" icon="el-icon-microphone" size="mini" style="margin-right:5px" @click.stop="addChatboxUserBlacklist(scope.row.ref)")
span(v-text="scope.row.photonId")
el-table-column(:label="$t('table.playerList.icon')" prop="isMaster" width="70" align="center")
template(v-once #default="scope")
template(#default="scope")
el-tooltip(v-if="scope.row.isMaster" placement="left" content="Instance Master")
span 👑
el-tooltip(v-if="scope.row.isModerator" placement="left" content="Moderator")
@@ -233,7 +233,7 @@ mixin playerListTab()
el-tooltip(v-if="scope.row.timeoutTime" placement="left" content="Timeout")
span(style="color:red") 🔴{{ scope.row.timeoutTime }}s
el-table-column(:label="$t('table.playerList.platform')" prop="inVRMode" width="80")
template(v-once #default="scope")
template(#default="scope")
template(v-if="scope.row.ref.last_platform")
span(v-if="scope.row.ref.last_platform === 'standalonewindows'" style="color:#409eff") PC
span(v-else-if="scope.row.ref.last_platform === 'android'" style="color:#67c23a") A
@@ -244,11 +244,11 @@ mixin playerListTab()
span(v-else-if="scope.row.ref.last_platform === 'android' || scope.row.ref.last_platform === 'ios'") M
span(v-else) D
el-table-column(:label="$t('table.playerList.displayName')" min-width="140" prop="displayName" sortable="custom")
template(v-once #default="scope")
template(#default="scope")
span(v-if="randomUserColours" v-text="scope.row.ref.displayName" :style="{'color':scope.row.ref.$userColour}")
span(v-else v-text="scope.row.ref.displayName")
el-table-column(:label="$t('table.playerList.status')" min-width="180" prop="ref.status")
template(v-once #default="scope")
template(#default="scope")
template(v-if="scope.row.ref.status")
i.x-user-status(:class="statusClass(scope.row.ref.status)")
span
@@ -257,18 +257,19 @@ mixin playerListTab()
//- template(v-once #default="scope")
//- span(v-text="scope.row.groupOnNameplate")
el-table-column(:label="$t('table.playerList.rank')" width="110" prop="$trustSortNum" sortable="custom")
template(v-once #default="scope")
template(#default="scope")
span.name(v-text="scope.row.ref.$trustLevel" :class="scope.row.ref.$trustClass")
el-table-column(:label="$t('table.playerList.language')" width="100" prop="ref.$languages")
template(v-once #default="scope")
template(#default="scope")
el-tooltip(v-for="item in scope.row.ref.$languages" :key="item.key" placement="top")
template(#content)
span {{ item.value }} ({{ item.key }})
span.flags(:class="languageClass(item.key)" style="display:inline-block;margin-right:5px")
el-table-column(:label="$t('table.playerList.bioLink')" width="100" prop="ref.bioLinks")
template(v-once #default="scope")
template(#default="scope")
div(style="display:flex;align-items:center")
el-tooltip(v-if="link" v-for="(link, index) in scope.row.ref.bioLinks" :key="index")
template(#content)
span(v-text="link")
img(:src="getFaviconUrl(link)" style="width:16px;height:16px;vertical-align:middle;margin-right:5px;cursor:pointer" @click.stop="openExternalLink(link)")