fix(stage-web,stage-tamagotchi,stage-ui): eliminate reactive use
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
import { useProvidersStore } from '@proj-airi/stage-ui/stores'
|
||||
import { FieldKeyValues } from '@proj-airi/ui'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { computed, onMounted, reactive, watch } from 'vue'
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
@@ -52,7 +52,7 @@ function handleResetSettings() {
|
||||
}
|
||||
}
|
||||
|
||||
const headers = reactive<{ key: string, value: string }[]>([
|
||||
const headers = ref<{ key: string, value: string }[]>([
|
||||
{ key: '', value: '' },
|
||||
])
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { onBeforeUnmount, onMounted, reactive } from 'vue'
|
||||
import { onBeforeUnmount, onMounted, ref } from 'vue'
|
||||
|
||||
interface Props {
|
||||
petalCount?: number
|
||||
@@ -26,7 +26,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
baseColor: '#FFB6C1',
|
||||
})
|
||||
|
||||
const petals = reactive<Petal[]>([])
|
||||
const petals = ref<Petal[]>([])
|
||||
let animationInterval: number | null = null
|
||||
|
||||
function createPetalStyle() {
|
||||
@@ -43,9 +43,9 @@ function createPetalStyle() {
|
||||
}
|
||||
|
||||
function createPetals() {
|
||||
petals.length = 0
|
||||
petals.value.length = 0
|
||||
for (let i = 0; i < props.petalCount; i++) {
|
||||
petals.push({
|
||||
petals.value.push({
|
||||
id: Date.now() + i,
|
||||
style: createPetalStyle(),
|
||||
})
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
import { useProvidersStore } from '@proj-airi/stage-ui/stores'
|
||||
import { FieldKeyValues } from '@proj-airi/ui'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { computed, onMounted, reactive, watch } from 'vue'
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
@@ -52,7 +52,7 @@ function handleResetSettings() {
|
||||
}
|
||||
}
|
||||
|
||||
const headers = reactive<{ key: string, value: string }[]>([
|
||||
const headers = ref<{ key: string, value: string }[]>([
|
||||
{ key: '', value: '' },
|
||||
])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user