button.uvue 2.6 KB
Newer Older
Y
init  
yurj26 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
<template>
    <view>
        <page-head :title="title"></page-head>
        <view class="uni-padding-wrap uni-common-mt">
            <button type="primary">页面主操作 Normal</button>
            <!-- <button type="primary" :loading="loading" class="button">页面主操作 Loading</button> -->
            <button type="primary" :disabled="true" class="button">页面主操作 Disabled</button>

            <button type="default" class="button">页面次要操作 Normal</button>
            <button type="default" :disabled="true" class="button">页面次要操作 Disabled</button>

            <button type="warn" class="button">警告类操作 Normal</button>
            <button type="warn" :disabled="true" class="button">警告类操作 Disabled</button>

            <view class="button-sp-area">
                <button type="primary" :plain="true" class="button">按钮</button>
                <button type="primary" :disabled="true" :plain="true" class="button">
                    不可点击的按钮
                </button>

                <button type="default" :plain="true" class="button">按钮</button>
                <button type="default" :disabled="true" :plain="true" class="button">按钮</button>

                <view class="uni-flex uni-row">
                    <button class="button mini-btn" type="primary" size="mini">按钮</button>
                    <button class="button mini-btn" type="default" size="mini">按钮</button>
                    <button class="button mini-btn" type="warn" size="mini">按钮</button>
                </view>
            </view>
        </view>
    </view>
</template>
<script lang="ts">
    export default {
        data() {
            return {
                title: 'button',
                loading: false,
                _timer: 0
            }
        },
        onShow() {
            // this.clearTimer();
            // this._timer = setTimeout(() => {
            //     // this.loading = true;
            // }, 300)
        },
        onUnload() {
            // this.clearTimer();
            // this.loading = false;
        },
        methods: {
            // clearTimer() {
            //     if (this._timer != 0) {
            //         clearTimeout(this._timer);
            //     }
            // }
        },
    }
</script>

<style>
    .button {
        margin-top: 30rpx;
    }

    .button-sp-area {
        margin: 0 auto;
        width: 60%;
    }

    .mini-btn {
        margin-right: 10rpx;
        margin-bottom: 30rpx;
    }
</style>