🐛 解决控制台报错

This commit is contained in:
BTMuli
2023-06-29 16:01:11 +08:00
parent 922ab7fa5d
commit be12e83be7
2 changed files with 10 additions and 8 deletions

View File

@@ -9,6 +9,8 @@ extends:
- plugin:prettier/recommended - plugin:prettier/recommended
parser: vue-eslint-parser parser: vue-eslint-parser
parserOptions: parserOptions:
extraFileExtensions:
- .vue
parser: "@typescript-eslint/parser" parser: "@typescript-eslint/parser"
project: project:
- tsconfig.json - tsconfig.json

View File

@@ -21,13 +21,13 @@
<div class="tuc-rb-bottom"> <div class="tuc-rb-bottom">
<div class="tuc-rbb-bg"> <div class="tuc-rbb-bg">
<img <img
v-if="nameCard !== false && props.modelValue.fetter === 10"
:src="nameCard" :src="nameCard"
alt="nameCard" alt="nameCard"
v-if="nameCard !== false && props.modelValue.fetter === 10"
/> />
</div> </div>
<div class="tuc-rbb-content" v-show="talents.length > 0"> <div v-show="talents.length > 0" class="tuc-rbb-content">
<div v-for="talent in talents" class="tuc-rbb-talent"> <div v-for="talent in talents" :key="talent.pos" class="tuc-rbb-talent">
<img :src="talent.icon" alt="talent" /> <img :src="talent.icon" alt="talent" />
<span>Lv.{{ talent.level }}</span> <span>Lv.{{ talent.level }}</span>
</div> </div>
@@ -64,12 +64,12 @@ const avatarBox = computed(() => {
innerHeight: 20, innerHeight: 20,
outerText: getAvatarName(), outerText: getAvatarName(),
outerHeight: 20, outerHeight: 20,
display: "outer" as "outer", display: <"outer">"outer",
clickable: true, clickable: true,
}; };
}); });
const weaponBox = computed(() => { const weaponBox = computed(() => {
const weapon = JSON.parse(props.modelValue.weapon) as TGApp.Sqlite.Character.RoleWeapon; const weapon = <TGApp.Sqlite.Character.RoleWeapon>JSON.parse(props.modelValue.weapon);
return { return {
size: "80px", size: "80px",
height: "100px", height: "100px",
@@ -83,11 +83,11 @@ const weaponBox = computed(() => {
innerHeight: 20, innerHeight: 20,
outerText: weapon.name, outerText: weapon.name,
outerHeight: 20, outerHeight: 20,
display: "outer" as "outer", display: <"outer">"outer",
clickable: true, clickable: true,
}; };
}); });
const nameCard = ref(false as string | false); const nameCard = ref<string | false>(false);
onMounted(async () => { onMounted(async () => {
if (props.modelValue.cid !== 10000005 && props.modelValue.cid !== 10000007) { if (props.modelValue.cid !== 10000005 && props.modelValue.cid !== 10000007) {
@@ -118,7 +118,7 @@ function getAvatarName() {
// 销毁 // 销毁
onUnmounted(() => { onUnmounted(() => {
talents.value.map((talent) => { talents.value.map((talent) => {
URL.revokeObjectURL(talent.icon); return URL.revokeObjectURL(talent.icon);
}); });
}); });
</script> </script>