如下所示:
.page{ list-style: none; } .page>li{ float: left; margin-left: 10px; } .page>li>a{ text-decoration: none; } .active{ color: red; text-decoration: display; } div{ width: 500px;height: 500px; }
- 上一页
- {{n}}
- 下一页
自定义指令实现随机背景 #app{ width: 999px; height: 999px; } 自定义指令
补充知识:vue统一设置了背景色,单独改变某一页的背景色
有时我们会遇到单独改变某个组件的背景填充色,而我们已经在index.html中引入了公用的css样式(body中设置了背景色),由于单个组件没有body标签,于是要修改单个组件的背景色只需添加如下代码即可。
beforeCreate () {
document.querySelector('body').setAttribute('style', 'margin: 0 auto; width: 100%; max-width: 750px;min-width: 300px; background:#171b2a; overflow-x: hidden;height: 100%;');
}
以上这篇Vue实现背景更换颜色操作就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持考高分网。



