当前位置: 首页 > news >正文

宝山网站建设哪家好平面设计公司简介模板

宝山网站建设哪家好,平面设计公司简介模板,汉川做网站,可以做app的网站有哪些文章目录 v-bind对样式控制的增强2.1 操作class2.1.1 语法2.1.2 对象语法2.1.3 数组语法2.1.4 使用2.1.5 Test 2.2 操作style2.2.1 语法2.2.2 使用2.2.3 Test v-bind对样式控制的增强 2.1 操作class 2.1.1 语法 <div> :class "对象/数组">这是一个div&l…

文章目录

  • v-bind对样式控制的增强
    • 2.1 操作class
      • 2.1.1 语法
      • 2.1.2 对象语法
      • 2.1.3 数组语法
      • 2.1.4 使用
      • 2.1.5 Test
    • 2.2 操作style
      • 2.2.1 语法
      • 2.2.2 使用
      • 2.2.3 Test

v-bind对样式控制的增强

2.1 操作class

2.1.1 语法

<div> :class = "对象/数组">这是一个div</div>

2.1.2 对象语法

当class动态绑定的是对象时,键就是类名,值就是布尔值,如果值是true,就有这个类,否则没有这个类

<div class="box" :class="{ 类名1: 布尔值, 类名2: 布尔值 }"></div>

适用场景:一个类名,来回切换

2.1.3 数组语法

当class动态绑定的是数组时 → 数组中所有的类,都会添加到盒子上,本质就是一个 class 列表

<div class="box" :class="[ 类名1, 类名2, 类名3 ]"></div><div class="box" :class="[ '类名1', '类名2', '类名3' ]"></div>

使用场景:批量添加或删除类

2.1.4 使用

<style>.box {width: 50px;height: 50px;border: 1px solid #000;margin-top: 5px;}.red {background-color: red;}.big {width: 100px; height: 100px;}</style>
</head>
<body><div id="app"><div class="box" :class="{ big: true, red: true }">你好Java</div><div class="box" :class="['red', 'big']">你好Java</div></div><script src="js/vue.js"></script><script>const app = new Vue({el: '#app',data: {}})</script>
</body>

2.1.5 Test

<style>* {margin: 0;padding: 0;}ul {display: flex;border-bottom: 2px solid #1e3c9f;padding: 0 10px;}li {width: 100px;height: 50px;line-height: 50px;list-style: none;text-align: center;}li a {display: block;text-decoration: none;font-weight: bold;color: #333333;}li a.active {background-color: #12e06f;color: #fff;}</style>
</head>
<body><div id="app"><ul><li v-for="(item ,index) in list" :key="item.id" @click="activeIndex = index"><a href="#" :class="{active: index === activeIndex}">{{item.name}}</a></li></ul></div><script src="js/vue.js"></script><script>const app = new Vue({el: '#app',data: {activeIndex: 0, // 记录高亮list: [{id: 1,name: '商品秒杀'}, {id: 2,name: '特价处理'}, {id: 3,name: '品牌优惠'}]}})</script>
</body>

2.2 操作style

2.2.1 语法

:style中的css属性会覆盖 class="box"的css样式

<div class="box" :style="{ CSS属性名1: CSS属性值, CSS属性名2: CSS属性值 }"></div>

2.2.2 使用

<style>.box {width: 50px;height: 50px;background-color: red;}</style>
</head><body><div id="app"><div class="box" :style="{ width: '100px', height: '100px', backgroundColor: 'green' }"></div></div><script src="js/vue.js"></script><script>const app = new Vue({el: '#app',data: {}})</script>
</body>

2.2.3 Test

 <style>.progress {height: 25px;width: 400px;border-radius: 15px;background-color: #272425;border: 3px solid #272425;box-sizing: border-box;margin-bottom: 30px;}.inner {width: 50%;height: 20px;border-radius: 10px;text-align: right;position: relative;background-color: #409eff;background-size: 20px 20px;box-sizing: border-box;transition: all 1s;}.inner span {position: absolute;right: -20px;bottom: -25px;}</style>
</head><body><div id="app"><!-- 外层盒子底色 (黑色) --><div class="progress"><!-- 内层盒子 - 进度(蓝色) --><div class="inner" :style="{ width: percent+'%' }"><span>{{ percent }}%</span></div></div><button @click="percent = 25">设置25%</button><button @click="percent = 50">设置50%</button><button @click="percent = 75">设置75%</button><button @click="percent = 100">设置100%</button></div><script src="js/vue.js"></script><script>const app = new Vue({el: '#app',data: {percent: 30}})</script>
</body>
http://www.15wanjia.com/news/169167.html

相关文章:

  • 正规的常州网站推广做网站还有希望吗
  • 图片搜索网站原创内容优化
  • 网站网页制作公司个人网站免备案吗
  • 濮阳做网站多少钱自助免费建站
  • 如何做摄影网站wordpress插件后门
  • 苏州网站开发公司兴田德润怎么联系上海的设计网站有哪些内容
  • vps网站压缩网站建设的目标和需求
  • 网站建设那里广州做网站建设的公司哪家好
  • 网站怎么做百科网站建设服务的风险
  • 国内做音乐网站杭州营销网站建设平台
  • 怎么上传自己做的网站保定企业免费建站
  • 怎么查询网站的域名重庆建设工程信息网官网二级建造师注册信息查询
  • 搜索网站定制公司交友免费的网站建设
  • 网站开发外包公司有哪些部门美食优秀设计网站
  • wordpress title 自定义哪有培训seo
  • 网站联动企业管理软件开发公司
  • 网站开发代做还有什么网站可以做面包车拉货
  • 购物网站建设珠海杭州的地区代码
  • 惠州网站建设l优选蓝速科技网站整合营销
  • 深圳有名的网站设计公司做外贸网站哪家公司好
  • 网站域名 空间自己动手建立个人网站
  • 都匀网站制作网络运营商无服务怎么恢复
  • 网站站内搜索代码做竞价推广的网站要求
  • 湖南企业网站网站按钮设计成什么颜色原因
  • 广告设计图片 创意长沙优化网站哪家公司好
  • 租个网站服务器多少钱如何注册咨询公司
  • 灰系网站提供网络推广服务
  • 怎么做帖子网站济南互联网公司排名
  • 免费网站重生九零做商女上海相亲网
  • 市网站制作青岛一点两区救治医院