帖子
帖子
用户
博客
课程
显示全部楼层
54
帖子
0
勋章
1407
Y币

[多端开发] 渐变问题

[复制链接]
发表于 2021-11-5 08:37:43
盒子点击改变背景颜色成渐变,再点击回到红色,现在不生效,麻烦大佬们给看看。
<template>
    <view class="page">
        <view class={'box '+(show?'red_bg':'')} @click="change"></view>
    </view>
</template>
<style>
.page{
    width: 100%;
    height: 100%;
}
.box{
    width: 100px;
    height: 100px;
    background: red;
    margin-top: 300px;  
}
.red_bg{
    background: linear-gradient(to right,rgba(23,135,216,1),rgba(13,102,166,1));
}
</style>
<script>
    export default {
        name: 'test',
        data(){
            return {
                show : false
            }
        },
        methods:{
            change(){
                this.show = !this.show
            }

        }
    }
</script>


380
帖子
4
勋章
6
Y币
我们确认一下
28
帖子
1
勋章
1万+
Y币
该问题已修复,重新编译再试试。
技术咨询-Kenny 发表于 2021-11-5 15:37
该问题已修复,重新编译再试试。

现在应该好了吧
您需要登录后才可以回帖 登录

本版积分规则