zhangxiaoxu123456
2021-12-20 301289e539c417995f95f5cb91fd1f6043bb7cfd
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
<template>
    <view class="u-demo">
        <view class="u-demo-wrap">
            <view class="u-demo-title">演示效果</view>
            <view class="u-demo-area">
                <u-link :color="color" :font-size="fontSize" :under-line="underLine" :href="href">点此链接,跳转uView官网</u-link>
            </view>
        </view>
        <view class="u-config-wrap">
            <view class="u-config-title u-border-bottom">
                参数配置
            </view>
            <view class="u-config-item">
                <view class="u-item-title">下划线</view>
                <u-subsection :list="['显示', '隐藏']" @change="underLineChange"></u-subsection>
            </view>
            <view class="u-config-item">
                <view class="u-item-title">自定义样式</view>
                <u-subsection current="1" :list="['是', '否']" @change="styleChange"></u-subsection>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                href: 'https://www.uviewui.com',
                underLine: true,
                fontSize: 28,
                color: '#2979ff'
            }
        },
        methods: {
            underLineChange(index) {
                this.underLine = index == 0 ? true : false;
            },
            styleChange(index) {
                if(index == 0) {
                    this.color = this.$u.color['tipsColor'];
                    this.fontSize = 34;
                } else {
                    this.color = this.$u.color['primary'];
                    this.fontSize = 28;
                }
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .u-demo {}
</style>