Vue动态调节演示

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue动态调节演示 - www.5cq.homes</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
    <style>
        body {
            font-family: Arial, sans-serif;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f5f5f5;
        }
        .control-panel {
            background-color: white;
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            margin-bottom: 20px;
        }
        .slider-container {
            margin-bottom: 15px;
        }
        .slider-container label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }
        input[type="range"] {
            width: 100%;
        }
        .preview-box {
            width: 200px;
            height: 200px;
            margin: 20px auto;
            border: 1px solid #ddd;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }
        .value-display {
            font-size: 14px;
            color: #666;
            margin-top: 5px;
        }
        .footer {
            text-align: center;
            margin-top: 30px;
            color: #888;
            font-size: 12px;
        }
    </style>
</head>
<body>
    <div id="app">
        <h1>Vue动态调节演示</h1>
        
        <div class="control-panel">
            <h2>样式调节器</h2>
            <p>通过以下滑块动态调整预览框的样式 - www.5cq.homes</p>
            
            <div class="slider-container">
                <label for="width">宽度: {{ width }}px</label>
                <input type="range" id="width" v-model="width" min="100" max="300">
            </div>
            
            <div class="slider-container">
                <label for="height">高度: {{ height }}px</label>
                <input type="range" id="height" v-model="height" min="100" max="300">
            </div>
            
            <div class="slider-container">
                <label for="borderRadius">圆角: {{ borderRadius }}px</label>
                <input type="range" id="borderRadius" v-model="borderRadius" min="0" max="100">
            </div>
            
            <div class="slider-container">
                <label for="rotation">旋转: {{ rotation }}deg</label>
                <input type="range" id="rotation" v-model="rotation" min="0" max="360">
            </div>
            
            <div class="slider-container">
                <label for="bgColor">背景颜色</label>
                <input type="color" id="bgColor" v-model="bgColor">
                <div class="value-display">当前值: {{ bgColor }}</div>
            </div>
        </div>
        
        <div class="preview-box" :style="{
            width: width + 'px',
            height: height + 'px',
            borderRadius: borderRadius + 'px',
            transform: 'rotate(' + rotation + 'deg)',
            backgroundColor: bgColor
        }">
            预览内容
        </div>
        
        <div class="footer">
            <p>演示结束 - 更多内容请访问: www.5cq.homes</p>
        </div>
    </div>

    <script>
        new Vue({
            el: '#app',
            data: {
                width: 200,
                height: 200,
                borderRadius: 0,
                rotation: 0,
                bgColor: '#ffffff'
            }
        });
    </script>
</body>
</html>

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值