提交 01276871 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

feat(lifecycle): 优化生命周期示例

上级 ba324ee1
<template> <template>
title: {{ title }} title: {{ title }}
<view class="uni-common-mt item-container">
<text>onLoad 触发:</text>
<text>{{ isOnloadTriggered }}</text>
</view>
<view class="item-container">
<text>onPageShow 触发:</text>
<text>{{ isOnShowTriggered }}</text>
</view>
<view class="item-container">
<text>onReady 触发:</text>
<text>{{ isOnReadyTriggered }}</text>
</view>
<view class="item-container">
<text>onBeforeMount 触发:</text>
<text>{{ isOnBeforeMountTriggered }}</text>
</view>
<view class="item-container">
<text>onMounted 触发:</text>
<text>{{ isOnMountedTriggered }}</text>
</view>
<view class="item-container">
<text>onBeforeUpdate 触发:</text>
<text>{{ isOnBeforeUpdateTriggered }}</text>
</view>
<view class="item-container">
<text>onUpdated 触发:</text>
<text>{{ isOnUpdatedTriggered }}</text>
</view>
<view class="item-container">
<text>onBeforeUnmount 触发:</text>
<text>{{ isOnBeforeUnmountTriggered }}</text>
</view>
<view class="item-container">
<text>onUnmounted 触发:</text>
<text>{{ isOnUnmountedTriggered }}</text>
</view>
<view class="item-container">
<text>onPullDownRefresh 触发:</text>
<text>{{ isOnPullDownRefreshTriggered }}</text>
</view>
<view class="item-container">
<text>onReachBottom 触发:</text>
<text>{{ isOnReachBottomTriggered }}</text>
</view>
<view class="item-container">
<text>onBackPress 触发:</text>
<text>{{ isOnBackPressTriggered }}</text>
</view>
<view class="item-container">
<text>onPageHide 触发:</text>
<text>{{ isOnHideTriggered }}</text>
</view>
<view class="item-container">
<text>onResize 触发:</text>
<text>{{ isOnResizeTriggered }}</text>
</view>
<button class="component-lifecycle-btn uni-common-mt" @click="updateTitle"> <button class="component-lifecycle-btn uni-common-mt" @click="updateTitle">
updateTitle updateTitle
</button> </button>
</template> </template>
<script setup> <script setup lang="uts">
import { state, setLifeCycleNum } from '../store/index.uts' import { state, setLifeCycleNum } from '../store/index.uts'
const title = ref('component for composition API lifecycle test') const title = ref('component for composition API lifecycle test')
const emit = defineEmits<{ const isOnloadTriggered = ref(false)
(e : 'updateIsScroll', val : boolean) : void const isOnShowTriggered = ref(false)
}>() const isOnReadyTriggered = ref(false)
const isOnPullDownRefreshTriggered = ref(false)
onLoad((_ : OnLoadOptions) => { const isOnPageScrollTriggered = ref(false)
// 自动化测试 const isOnReachBottomTriggered = ref(false)
setLifeCycleNum(state.lifeCycleNum + 100) const isOnBackPressTriggered = ref(false)
}) const isOnHideTriggered = ref(false)
onPageShow(() => { const isOnResizeTriggered = ref(false)
// 自动化测试
setLifeCycleNum(state.lifeCycleNum + 10) const isOnBeforeMountTriggered = ref(false)
}) const isOnMountedTriggered = ref(false)
onReady(() => { const isOnBeforeUpdateTriggered = ref(false)
// 自动化测试 const isOnUpdatedTriggered = ref(false)
// TODO: onReady 未触发 const isOnBeforeUnmountTriggered = ref(false)
setLifeCycleNum(state.lifeCycleNum + 10) const isOnUnmountedTriggered = ref(false)
})
const emit = defineEmits<{
onPullDownRefresh(() => { (e : 'updateIsScroll', val : boolean) : void
// 自动化测试 }>()
setLifeCycleNum(state.lifeCycleNum + 10)
}) onLoad((_ : OnLoadOptions) => {
onPageScroll((_) => { isOnloadTriggered.value = true
// 自动化测试 // 自动化测试
emit('updateIsScroll', true) setLifeCycleNum(state.lifeCycleNum + 100)
}) })
onReachBottom(() => { onPageShow(() => {
// 自动化测试 isOnShowTriggered.value = true
setLifeCycleNum(state.lifeCycleNum + 10) // 自动化测试
}) setLifeCycleNum(state.lifeCycleNum + 10)
onBackPress((_ : OnBackPressOptions) : boolean | null => { })
// 自动化测试 onReady(() => {
setLifeCycleNum(state.lifeCycleNum - 10) isOnReadyTriggered.value = true
return null // 自动化测试
}) // TODO: onReady 未触发
onPageHide(() => { setLifeCycleNum(state.lifeCycleNum + 10)
// 自动化测试 })
setLifeCycleNum(state.lifeCycleNum - 10)
}) onPullDownRefresh(() => {
onUnload(() => { isOnPullDownRefreshTriggered.value = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum - 100) setLifeCycleNum(state.lifeCycleNum + 10)
}) })
onPageScroll((_) => {
onBeforeMount(() => { isOnPageScrollTriggered.value = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 1) emit('updateIsScroll', true)
console.log('component for lifecycle test mounted') })
}) onReachBottom(() => {
isOnReachBottomTriggered.value = true
onMounted(() => { // 自动化测试
// 自动化测试 setLifeCycleNum(state.lifeCycleNum + 10)
setLifeCycleNum(state.lifeCycleNum + 1) })
console.log('component for lifecycle test mounted') onBackPress((_ : OnBackPressOptions) : boolean | null => {
}) isOnBackPressTriggered.value = true
// 自动化测试
onBeforeUpdate(() => { setLifeCycleNum(state.lifeCycleNum - 10)
// 自动化测试 return null
setLifeCycleNum(state.lifeCycleNum + 1) })
console.log('component for lifecycle test beforeUpdate') onPageHide(() => {
}) isOnHideTriggered.value = true
// 自动化测试
onUpdated(() => { setLifeCycleNum(state.lifeCycleNum - 10)
// 自动化测试 })
setLifeCycleNum(state.lifeCycleNum + 1) onUnload(() => {
console.log('component for lifecycle test updated') isOnHideTriggered.value = true
}) // 自动化测试
setLifeCycleNum(state.lifeCycleNum - 100)
onBeforeUnmount(() => { })
// 自动化测试
setLifeCycleNum(state.lifeCycleNum - 1) onBeforeMount(() => {
console.log('component for lifecycle test beforeUnmount') isOnBeforeMountTriggered.value = true
}) // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 1)
onUnmounted(() => { console.log('component for lifecycle test mounted')
// 自动化测试 })
setLifeCycleNum(state.lifeCycleNum - 1)
console.log('component for lifecycle test unmounted') onMounted(() => {
}) isOnMountedTriggered.value = true
// 自动化测试
// TODO: app-android 不触发 setLifeCycleNum(state.lifeCycleNum + 1)
onActivated(() => { }) console.log('component for lifecycle test mounted')
// TODO: app-android 不触发 })
onDeactivated(() => { })
onBeforeUpdate(() => {
const updateTitle = () => { isOnBeforeUpdateTriggered.value = true
title.value = 'component for lifecycle test updated' // 自动化测试
} setLifeCycleNum(state.lifeCycleNum + 1)
</script> console.log('component for lifecycle test beforeUpdate')
\ No newline at end of file })
onUpdated(() => {
isOnUpdatedTriggered.value = true
// 自动化测试
setLifeCycleNum(state.lifeCycleNum + 1)
console.log('component for lifecycle test updated')
})
onBeforeUnmount(() => {
isOnBeforeUnmountTriggered.value = true
// 自动化测试
setLifeCycleNum(state.lifeCycleNum - 1)
console.log('component for lifecycle test beforeUnmount')
})
onUnmounted(() => {
isOnUnmountedTriggered.value = true
// 自动化测试
setLifeCycleNum(state.lifeCycleNum - 1)
console.log('component for lifecycle test unmounted')
})
// TODO: app-android 不触发
onActivated(() => { })
// TODO: app-android 不触发
onDeactivated(() => { })
const updateTitle = () => {
title.value = 'component for lifecycle test updated'
}
</script>
<style>
.item-container {
margin-bottom: 10px;
display: flex;
justify-content: space-between;
flex-direction: row;
}
</style>
<template> <template>
title: {{ title }} title: {{ title }}
<view class="uni-common-mt item-container">
<text>beforeCreate 触发:</text>
<text>{{ isBeforeCreateTriggered }}</text>
</view>
<view class="item-container">
<text>created 触发:</text>
<text>{{ isCreatedTriggered }}</text>
</view>
<view class="item-container">
<text>beforeMount 触发:</text>
<text>{{ isBeforeMountTriggered }}</text>
</view>
<view class="item-container">
<text>mounted 触发:</text>
<text>{{ isMountedTriggered }}</text>
</view>
<view class="item-container">
<text>beforeUpdate 触发:</text>
<text>{{ isBeforeUpdateTriggered }}</text>
</view>
<view class="item-container">
<text>updated 触发:</text>
<text>{{ isUpdatedTriggered }}</text>
</view>
<view class="item-container">
<text>beforeUnmount 触发:</text>
<text>{{ isBeforeUnmountTriggered }}</text>
</view>
<view class="item-container">
<text>unmounted 触发:</text>
<text>{{ isUnmountedTriggered }}</text>
</view>
<button class="component-lifecycle-btn uni-common-mt" @click="updateTitle"> <button class="component-lifecycle-btn uni-common-mt" @click="updateTitle">
updateTitle updateTitle
</button> </button>
</template> </template>
<script> <script lang="uts">
import { state, setLifeCycleNum } from '../store/index.uts'; import { state, setLifeCycleNum } from '../store/index.uts';
export default { export default {
name: 'OptionsAPIComponentLifecycle', name: 'OptionsAPIComponentLifecycle',
data() { data() {
return { return {
title: 'component for options API lifecycle test', title: 'component for options API lifecycle test',
}; isBeforeCreateTriggered: false,
isCreatedTriggered: false,
isBeforeMountTriggered: false,
isMountedTriggered: false,
isBeforeUpdateTriggered: false,
isUpdatedTriggered: false,
isBeforeUnmountTriggered: false,
isUnmountedTriggered: false,
};
},
beforeCreate() {
setTimeout(() => {
this.isBeforeCreateTriggered = true
}, 0);
// 自动化测试
setLifeCycleNum(state.lifeCycleNum + 1);
console.log('component for lifecycle test beforeCreate');
},
created() {
this.isCreatedTriggered = true
// 自动化测试
setLifeCycleNum(state.lifeCycleNum + 1);
console.log('component for lifecycle test created');
},
beforeMount() {
this.isBeforeMountTriggered = true
// 自动化测试
setLifeCycleNum(state.lifeCycleNum + 1);
console.log('component for lifecycle test beforeMount');
},
mounted() {
this.isMountedTriggered = true
// 自动化测试
setLifeCycleNum(state.lifeCycleNum + 1);
console.log('component for lifecycle test mounted');
},
beforeUpdate() {
this.isBeforeUpdateTriggered = true
// 自动化测试
setLifeCycleNum(state.lifeCycleNum + 1);
console.log('component for lifecycle test beforeUpdate');
},
updated() {
this.isUpdatedTriggered = true
// 自动化测试
setLifeCycleNum(state.lifeCycleNum + 1);
console.log('component for lifecycle test updated');
},
beforeUnmount() {
this.isBeforeUnmountTriggered = true
// 自动化测试
setLifeCycleNum(state.lifeCycleNum - 1);
console.log('component for lifecycle test beforeUnmount');
},
unmounted() {
this.isUnmountedTriggered = true
// 自动化测试
setLifeCycleNum(state.lifeCycleNum - 1);
console.log('component for lifecycle test unmounted');
},
methods: {
updateTitle() {
this.title = 'component for lifecycle test updated';
}, },
beforeCreate() { },
// 自动化测试 };
setLifeCycleNum(state.lifeCycleNum + 1); </script>
console.log('component for lifecycle test beforeCreate');
}, <style>
created() { .item-container {
// 自动化测试 margin-bottom: 10px;
setLifeCycleNum(state.lifeCycleNum + 1); display: flex;
console.log('component for lifecycle test created'); justify-content: space-between;
}, flex-direction: row;
beforeMount() { }
// 自动化测试 </style>
setLifeCycleNum(state.lifeCycleNum + 1);
console.log('component for lifecycle test beforeMount');
},
mounted() {
// 自动化测试
setLifeCycleNum(state.lifeCycleNum + 1);
console.log('component for lifecycle test mounted');
},
beforeUpdate() {
// 自动化测试
setLifeCycleNum(state.lifeCycleNum + 1);
console.log('component for lifecycle test beforeUpdate');
},
updated() {
// 自动化测试
setLifeCycleNum(state.lifeCycleNum + 1);
console.log('component for lifecycle test updated');
},
beforeUnmount() {
// 自动化测试
setLifeCycleNum(state.lifeCycleNum - 1);
console.log('component for lifecycle test beforeUnmount');
},
unmounted() {
// 自动化测试
setLifeCycleNum(state.lifeCycleNum - 1);
console.log('component for lifecycle test unmounted');
},
methods: {
updateTitle() {
this.title = 'component for lifecycle test updated';
},
},
};
</script>
\ No newline at end of file
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
<!-- #ifdef APP --> <!-- #ifdef APP -->
<scroll-view style="flex:1"> <scroll-view style="flex:1">
<!-- #endif --> <!-- #endif -->
<view class="pag container"> <view class="page container">
<text class="uni-common-mb">component lifecycle</text>
<component-lifecycle class="component-lifecycle" @updateIsScroll="updateIsScroll" /> <component-lifecycle class="component-lifecycle" @updateIsScroll="updateIsScroll" />
<button class="uni-common-mt" @click="scrollToBottom">scrollToBottom</button> <button class="uni-common-mt" @click="scrollToBottom">scrollToBottom</button>
<button class="uni-common-mt" @click="pullDownRefresh">trigger pullDownRefresh</button>
</view> </view>
<!-- #ifdef APP --> <!-- #ifdef APP -->
</scroll-view> </scroll-view>
<!-- #endif --> <!-- #endif -->
</template> </template>
<script setup> <script setup lang='uts'>
import ComponentLifecycle from '@/components/CompositionAPILifecycle.uvue' import ComponentLifecycle from '@/components/CompositionAPILifecycle.uvue'
import { state, setLifeCycleNum } from '@/store/index.uts' import { state, setLifeCycleNum } from '@/store/index.uts'
......
...@@ -3,49 +3,100 @@ ...@@ -3,49 +3,100 @@
<scroll-view style="flex:1" :bounces="false"> <scroll-view style="flex:1" :bounces="false">
<!-- #endif --> <!-- #endif -->
<view class="page container"> <view class="page container">
<text>page lifecycle</text> <view class="item-container">
<text>onLoad 触发:</text>
<text>{{ isOnloadTriggered }}</text>
</view>
<view class="item-container">
<text>onShow 触发:</text>
<text>{{ isOnShowTriggered }}</text>
</view>
<view class="item-container">
<text>onReady 触发:</text>
<text>{{ isOnReadyTriggered }}</text>
</view>
<view class="item-container">
<text>onPullDownRefresh 触发:</text>
<text>{{ isOnPullDownRefreshTriggered }}</text>
</view>
<view class="item-container">
<text>onReachBottom 触发:</text>
<text>{{ isOnReachBottomTriggered }}</text>
</view>
<view class="item-container">
<text>onBackPress 触发:</text>
<text>{{ isOnBackPressTriggered }}</text>
</view>
<view class="item-container">
<text>onHide 触发:</text>
<text>{{ isOnHideTriggered }}</text>
</view>
<view class="item-container">
<text>onResize 触发:</text>
<text>{{ isOnResizeTriggered }}</text>
</view>
<button class="uni-common-mt" @click="scrollToBottom">scrollToBottom</button> <button class="uni-common-mt" @click="scrollToBottom">scrollToBottom</button>
<button class="uni-common-mt" @click="pullDownRefresh">
trigger pullDownRefresh
</button>
</view> </view>
<!-- #ifdef APP --> <!-- #ifdef APP -->
</scroll-view> </scroll-view>
<!-- #endif --> <!-- #endif -->
</template> </template>
<script setup> <script setup lang='uts'>
import { state, setLifeCycleNum } from '@/store/index.uts' import { state, setLifeCycleNum } from '@/store/index.uts'
const isScrolled = ref(false) const isScrolled = ref(false)
const isOnloadTriggered = ref(false)
const isOnShowTriggered = ref(false)
const isOnReadyTriggered = ref(false)
const isOnPullDownRefreshTriggered = ref(false)
const isOnPageScrollTriggered = ref(false)
const isOnReachBottomTriggered = ref(false)
const isOnBackPressTriggered = ref(false)
const isOnHideTriggered = ref(false)
const isOnResizeTriggered = ref(false)
onLoad((_: OnLoadOptions) => { onLoad((_: OnLoadOptions) => {
isOnloadTriggered.value = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 100) setLifeCycleNum(state.lifeCycleNum + 100)
}) })
onPageShow(() => { onPageShow(() => {
isOnShowTriggered.value = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 10) setLifeCycleNum(state.lifeCycleNum + 10)
}) })
onReady(() => { onReady(() => {
isOnReadyTriggered.value = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 10) setLifeCycleNum(state.lifeCycleNum + 10)
}) })
onPullDownRefresh(() => { onPullDownRefresh(() => {
isOnPullDownRefreshTriggered.value = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 10) setLifeCycleNum(state.lifeCycleNum + 10)
}) })
onPageScroll((_) => { onPageScroll((_) => {
isOnPageScrollTriggered.value = true
// 自动化测试 // 自动化测试
isScrolled.value = true isScrolled.value = true
}) })
onReachBottom(() => { onReachBottom(() => {
isOnReachBottomTriggered.value = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 10) setLifeCycleNum(state.lifeCycleNum + 10)
}) })
onBackPress((_: OnBackPressOptions): boolean | null => { onBackPress((_: OnBackPressOptions): boolean | null => {
isOnBackPressTriggered.value = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum - 10) setLifeCycleNum(state.lifeCycleNum - 10)
return null return null
}) })
onPageHide(() => { onPageHide(() => {
isOnPageHideTriggered.value = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum - 10) setLifeCycleNum(state.lifeCycleNum - 10)
}) })
...@@ -54,6 +105,7 @@ ...@@ -54,6 +105,7 @@
setLifeCycleNum(state.lifeCycleNum - 100) setLifeCycleNum(state.lifeCycleNum - 100)
}) })
onResize((_) => { onResize((_) => {
isOnResizeTriggered.value = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 10) setLifeCycleNum(state.lifeCycleNum + 10)
}) })
...@@ -102,4 +154,10 @@ ...@@ -102,4 +154,10 @@
.container { .container {
height: 1200px; height: 1200px;
} }
.item-container {
margin-bottom: 10px;
display: flex;
justify-content: space-between;
flex-direction: row;
}
</style> </style>
\ No newline at end of file
<template> <template>
<view class="page"> <view class="page">
<text class="uni-common-mb">component lifecycle</text>
<component-lifecycle class="component-lifecycle" /> <component-lifecycle class="component-lifecycle" />
</view> </view>
</template> </template>
<script> <script lang="uts">
import ComponentLifecycle from '@/components/OptionsAPILifecycle.uvue' import ComponentLifecycle from '@/components/OptionsAPILifecycle.uvue'
import { state } from '@/store/index.uts' import { state } from '@/store/index.uts'
export default { export default {
......
...@@ -3,8 +3,44 @@ ...@@ -3,8 +3,44 @@
<scroll-view style="flex: 1" :bounces="false"> <scroll-view style="flex: 1" :bounces="false">
<!-- #endif --> <!-- #endif -->
<view class="page container"> <view class="page container">
<text>page lifecycle</text> <view class="item-container">
<button class="uni-common-mt" @click="scrollToBottom">scrollToBottom</button> <text>onLoad 触发:</text>
<text>{{ isOnloadTriggered }}</text>
</view>
<view class="item-container">
<text>onShow 触发:</text>
<text>{{ isOnShowTriggered }}</text>
</view>
<view class="item-container">
<text>onReady 触发:</text>
<text>{{ isOnReadyTriggered }}</text>
</view>
<view class="item-container">
<text>onPullDownRefresh 触发:</text>
<text>{{ isOnPullDownRefreshTriggered }}</text>
</view>
<view class="item-container">
<text>onReachBottom 触发:</text>
<text>{{ isOnReachBottomTriggered }}</text>
</view>
<view class="item-container">
<text>onBackPress 触发:</text>
<text>{{ isOnBackPressTriggered }}</text>
</view>
<view class="item-container">
<text>onHide 触发:</text>
<text>{{ isOnHideTriggered }}</text>
</view>
<view class="item-container">
<text>onResize 触发:</text>
<text>{{ isOnResizeTriggered }}</text>
</view>
<button class="uni-common-mt" @click="scrollToBottom">
scrollToBottom
</button>
<button class="uni-common-mt" @click="pullDownRefresh">
trigger pullDownRefresh
</button>
</view> </view>
<!-- #ifdef APP --> <!-- #ifdef APP -->
</scroll-view> </scroll-view>
...@@ -18,38 +54,55 @@ export default { ...@@ -18,38 +54,55 @@ export default {
data() { data() {
return { return {
isScrolled: false, isScrolled: false,
isOnloadTriggered: false,
isOnShowTriggered: false,
isOnReadyTriggered: false,
isOnPullDownRefreshTriggered: false,
isOnPageScrollTriggered: false,
isOnReachBottomTriggered: false,
isOnBackPressTriggered: false,
isOnHideTriggered: false,
isOnResizeTriggered: false,
} }
}, },
onLoad(_ : OnLoadOptions) { onLoad(_ : OnLoadOptions) {
this.isOnloadTriggered = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 100) setLifeCycleNum(state.lifeCycleNum + 100)
}, },
onShow() { onShow() {
this.isOnShowTriggered = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 10) setLifeCycleNum(state.lifeCycleNum + 10)
}, },
onReady() { onReady() {
this.isOnReadyTriggered = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 10) setLifeCycleNum(state.lifeCycleNum + 10)
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.isOnPullDownRefreshTriggered = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 10) setLifeCycleNum(state.lifeCycleNum + 10)
}, },
onPageScroll(_) { onPageScroll(_) {
this.isOnPageScrollTriggered = true
// 自动化测试 // 自动化测试
this.isScrolled = true this.isScrolled = true
}, },
onReachBottom() { onReachBottom() {
this.isOnReachBottomTriggered = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 10) setLifeCycleNum(state.lifeCycleNum + 10)
}, },
onBackPress(_ : OnBackPressOptions) : boolean | null { onBackPress(_ : OnBackPressOptions) : boolean | null {
this.isOnBackPressTriggered = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum - 10) setLifeCycleNum(state.lifeCycleNum - 10)
return null return null
}, },
onHide() { onHide() {
this.isOnHideTriggered = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum - 10) setLifeCycleNum(state.lifeCycleNum - 10)
}, },
...@@ -58,6 +111,7 @@ export default { ...@@ -58,6 +111,7 @@ export default {
setLifeCycleNum(state.lifeCycleNum - 100) setLifeCycleNum(state.lifeCycleNum - 100)
}, },
onResize(_){ onResize(_){
this.isOnResizeTriggered = true
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 10) setLifeCycleNum(state.lifeCycleNum + 10)
}, },
...@@ -94,4 +148,10 @@ export default { ...@@ -94,4 +148,10 @@ export default {
.container { .container {
height: 1200px; height: 1200px;
} }
.item-container {
margin-bottom: 10px;
display: flex;
justify-content: space-between;
flex-direction: row;
}
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册