uni-app-组件

uni-app组件生命周期与vue同

index

<template>
    <view>
        <login></login>
    </view>
</template>

<script>
    import login from ../../components/login/login.vue
    export default {
        data() {
            return {}
        },
        onLoad() {},
        methods: {},
        components: {
            login
        }
    }
</script>

组件

<template>
    <view>
        <view>组件</view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                intId: null
            };
        },
        created() {
            console.log("1")
            this.intId = setInterval(() => {
                console.log("执行定时器")
            }, 1000)
        },
        destroyed() {
            clearInterval(this.intId)
        }
    }
</script>

<style>

</style>

 

uni-app-组件

上一篇:Single Sign On (SSO) for cross-domain ASP.NET applications: Part-II - The implementation(转发)(待续)


下一篇:ios NSNumber详解