<!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>
992

被折叠的 条评论
为什么被折叠?



