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

fix(store): reactive warning

上级 43085e7a
<script lang="ts"> <script lang="uts">
import { state, setLifeCycleNum } from './store/index.uts' import { state, setLifeCycleNum } from '@/store/index.uts'
export default { export default {
onLaunch: function () { onLaunch: function () {
// 自动化测试 // 自动化测试
......
...@@ -4,17 +4,21 @@ ...@@ -4,17 +4,21 @@
<view class="uni-padding-wrap"> <view class="uni-padding-wrap">
<text>点击按钮调用 App.uvue methods</text> <text>点击按钮调用 App.uvue methods</text>
<text class="margin-top:6px;">increasetLifeCycleNum 方法</text> <text class="margin-top:6px;">increasetLifeCycleNum 方法</text>
<button class="uni-common-mt" @click="_increasetLifeCycleNum">increase lifeCycleNum</button> <button class="uni-common-mt" @click="_increasetLifeCycleNum">
increase lifeCycleNum
</button>
<text class="uni-common-mt">lifeCycleNum: {{ lifeCycleNum }}</text> <text class="uni-common-mt">lifeCycleNum: {{ lifeCycleNum }}</text>
</view> </view>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="uts">
import { state, setLifeCycleNum } from '@/store/index.uts' import { State, state, setLifeCycleNum } from '@/store/index.uts'
export default { export default {
data() { data() {
return { return {
_state: state as State,
lifeCycleNum: 0, lifeCycleNum: 0,
} }
}, },
......
...@@ -16,11 +16,12 @@ ...@@ -16,11 +16,12 @@
</view> </view>
</template> </template>
<script lang="ts"> <script lang="uts">
class Page { class Page {
constructor(public route : string) { constructor(public route : string) {
} }
} }
export default { export default {
data() { data() {
return { return {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</view> </view>
</template> </template>
<script lang="ts"> <script lang="uts">
export default { export default {
data() { data() {
return { return {
......
...@@ -45,11 +45,13 @@ ...@@ -45,11 +45,13 @@
</view> </view>
</template> </template>
<script lang="ts"> <script lang="uts">
import { state, setLifeCycleNum } from '@/store/index.uts' import { State, state, setLifeCycleNum } from '@/store/index.uts'
export default { export default {
data() { data() {
return { return {
_state: state as State,
onLoadTime: 0, onLoadTime: 0,
onShowTime: 0, onShowTime: 0,
onReadyTime: 0, onReadyTime: 0,
......
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
</view> </view>
</template> </template>
<script lang="ts"> <script lang="uts">
import { state } from '@/store/index.uts' import { state } from '@/store/index.uts'
export default { export default {
data() { data() {
return { return {
......
...@@ -5,11 +5,13 @@ ...@@ -5,11 +5,13 @@
</view> </view>
</template> </template>
<script lang="ts"> <script lang="uts">
import { state, setLifeCycleNum } from '@/store/index.uts' import { State, state, setLifeCycleNum } from '@/store/index.uts'
export default { export default {
data() { data() {
return { return {
_state: state as State,
isScrolled: false, isScrolled: false,
} }
}, },
......
...@@ -12,9 +12,15 @@ ...@@ -12,9 +12,15 @@
</view> </view>
</template> </template>
<script lang="ts"> <script lang="uts">
import { state, setLifeCycleNum } from '@/store/index.uts' import { State, state, setLifeCycleNum } from '@/store/index.uts'
export default { export default {
data() {
return {
_state: state as State
}
},
methods: { methods: {
setNavigationBarColor1() { setNavigationBarColor1() {
uni.setNavigationBarColor({ uni.setNavigationBarColor({
......
type State = { export type State = {
lifeCycleNum: number lifeCycleNum: number
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册