|
|
@ -62,7 +62,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
<script lang="ts" setup> |
|
|
|
import { useStore } from "vuex"; |
|
|
|
import { useStore } from "vuex"; |
|
|
|
import { computed, onMounted, ref } from "vue"; |
|
|
|
import { computed, onMounted, onBeforeUnmount } from "vue"; |
|
|
|
import { useI18n } from "vue3-i18n"; |
|
|
|
import { useI18n } from "vue3-i18n"; |
|
|
|
import { Tooltip } from "@/components" |
|
|
|
import { Tooltip } from "@/components" |
|
|
|
import { formartNum } from "@/tool"; |
|
|
|
import { formartNum } from "@/tool"; |
|
|
@ -70,12 +70,19 @@ import { attr_icon_urls } from "@/config"; |
|
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n(); |
|
|
|
const { t } = useI18n(); |
|
|
|
const { state, commit, dispatch } = useStore(); |
|
|
|
const { state, commit, dispatch } = useStore(); |
|
|
|
|
|
|
|
let interval = 0; |
|
|
|
const attribute = computed(() => { |
|
|
|
const attribute = computed(() => { |
|
|
|
return state.playerAttribute.attribute; |
|
|
|
return state.playerAttribute.attribute; |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => { }); |
|
|
|
onMounted(() => { |
|
|
|
|
|
|
|
interval = setInterval(() => { |
|
|
|
|
|
|
|
commit('add_player_curhp', Math.ceil(attribute.value.hp * 0.02)) |
|
|
|
|
|
|
|
}, 1000); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
onBeforeUnmount(() => { |
|
|
|
|
|
|
|
clearInterval(interval); |
|
|
|
|
|
|
|
}) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.attribute { |
|
|
|
.attribute { |
|
|
|