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

建设品牌型网站抖音带运营

建设品牌型网站,抖音带运营,进入网站wordpress配置,wordpress在固定链接设置页面目录 绑定对象 绑定数组 用在组件上 组件内只有一个根元素 组件内有多个元素 class与动态class是可以一起使用的 绑定对象 :class { 类名1: 判断条件1, 类名2: 判断条件2, ... } 如果类名后面对应的条件成立#xff0c;则类名就会添加 案例 template { 类名1: 判断条件1, 类名2: 判断条件2, ... } 如果类名后面对应的条件成立则类名就会添加 案例 template!-- 这里flag为true,所以存在 bg 这个类名 加上本来的类名 box, 则现在的div的类名为 box bg --div classbox :class{ bg: flag }/div /templatescript setup langts import { ref } from vueconst flag ref(true) /scriptstyle .box {width: 500px;height: 300px;margin: 50px auto; }.bg {background: pink; } /style当然我们也可以直接给class绑定一个对象 template!-- 这里flag为true,所以存在 bg 这个类名 加上本来的类名 box, 则现在的div的类名为 box bg --div classbox :classstyleObj/div /templatescript setup langts import { ref } from vueconst flag ref(true)const styleObj ref({ bg: flag.value }) /scriptstyle .box {width: 500px;height: 300px;margin: 50px auto; }.bg {background: pink; } /style也可以绑定一个计算属性 template!-- 这里flag为true,所以存在 bg 这个类名 加上本来的类名 box, 则现在的div的类名为 box bg --div classbox :classstyleObj/div /templatescript setup langts import { ref, computed } from vueconst flag ref(true)const styleObj computed(() ({ bg: flag.value })) /scriptstyle .box {width: 500px;height: 300px;margin: 50px auto; }.bg {background: pink; } /style绑定数组 也可以使用一个数组来绑定多个 class数组中我们可以写  三元表达式  对象形式  直接写类名 :class[ 直接写类名 , { 类名1: 判断条件1, 类名2: 判断条件2, ... } , 类名 条件1条件2 , ... ] template!-- 数组中多个类名之间用逗号分隔。可以直接写类名也可以写三元还可以写对象形式 --div classbox :class[{ bg: flag }, w500, flag ? h300: ]/div /templatescript setup langts import { ref } from vueconst flag ref(true) /scriptstyle .box {margin: 50px auto; }.bg {background: pink; }.w500 {width: 500px; }.h300 {height: 300px; } /style用在组件上 组件内只有一个根元素 会直接添加到根元素上 父组件 template!-- 因为Son组件内只有一个跟元素所以类名都会添加到Son组件的根元素上 --Son :class[box, { bg: flag }, flag ? w500 : , h300]/Son /templatescript setup langts import { ref } from vue import Son from ./Son.vueconst flag ref(true) /scriptstyle .box {margin: 50px auto; }.bg {background: pink; }.w500 {width: 500px; }.h300 {height: 300px; } /style子组件 templatediv子组件/div /template 组件内有多个元素 需要指定哪个根元素来接收这个 class。可以通过组件的 $attrs 属性来实现指定 $attrs会把props没有声明接收的全部接收过来起到了一个兜底的作用 父组件 template!-- Son组件内有多个跟元素则就需要Son组件内某个跟组件借助$attrs进行接收使用 --Son :class[box, { bg: flag }, flag ? w500 : , h300]/Son /templatescript setup langts import { ref } from vue import Son from ./AboutView.vueconst flag ref(true) /scriptstyle .box {margin: 50px auto; }.bg {background: pink; }.w500 {width: 500px; }.h300 {height: 300px; } /style子组件 templatediv :class$attrs.class子组件/divdiv多个跟标签 -- {{ $attrs }}/div /templatescript setup langts import { useAttrs } from vue// 可以使用 useAttrs 这个函数查看没有被 props 接收的数据 const attrs useAttrs() console.log(attrs) /script
http://www.pierceye.com/news/382402/

相关文章:

  • 互联网营销网站建设印章在线生成
  • 厦门seo网站管理南宁广告网页设计人才招聘
  • 沂水住房与城乡建设局网站wordpress如何建立论坛
  • 贵州省文化旅游网站建设的必要性查网站流量的网址
  • 自己做的网站怎么传到空间啊平面设计技术培训机构
  • php 做网站xml地图回龙观手机网站开发服务
  • 四川建设工程网上合同备案网站如何重新打开wordpress
  • 免费个人网站模板下载qq邮箱企业邮箱注册
  • 泰兴市网站建设wp怎么打开wordpress
  • wordpress可以建哪些网站吗开发app需要多少人
  • 0基础学做网站什么做网站做个网站一般要多少钱啊
  • 外贸营销型网站建设多少钱wordpress付费浏览
  • 网站空间可以换吗进网站备案
  • 番禺建设网站开发软件工程专业介绍
  • 如何做网站定位网站建设报价新鸿儒
  • 商务网站建设包含了河北招投标公共服务平台
  • 高权重网站怎么发软文外贸平台app
  • nas服务器 做网站网页设计页面图片
  • 青海建设协会网站电子商务网站备案
  • 性价比高的广州网站建设不同用户入口的网站样板
  • 投资交易网站开发黑镜wordpress主题破解
  • 文化传媒公司网站建设西渡网站建设
  • 购物网站为什么做移动端seo优化快速排名
  • iis服务器网站301重定向怎么做国家企业信息公开网查询系统
  • 免费家具网站模板做网站去什么公司好
  • 五个网站南宁网页制作培训
  • 枣庄建设网站wordpress如何自己编辑
  • 河南省城乡住房建设厅网站首页哪个公司网站备案快
  • 湘潭做网站价格优选磐石网络微信里怎么进入自己的公众号
  • 孟州网站wordpress主题游戏cms