本地静态图片

<template><view class="max"><image src="../../static/bg.png" mode=""></image></view>
</template><script>export default {data() {return {}},methods: {}}
</script><style lang="scss" scoped>.max{image{z-index:-1; width:100%; height:100%; position: fixed; top:0; }}
</style>

cdn图片

<template><view class=""><view class="max"><imagesrc="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-59f27697-00c5-4f1e-8c67-bb56e1e19e78/653c2495-cb7b-49a7-b6cb-f048e16fa5a7.jpg"mode=""></image></view></view>
</template><script>export default {data() {return {}},methods: {}}
</script><style lang="scss" scoped>.max{image{z-index:-1; width:100%; height:100%; position: fixed; top:0; }}
</style>

设置背景色

<template><view class="container">  //最外层<view class="bg-colore"></view>  //此标签为最外层view标签的第一个子标签<view class="content"></view></view>
</template>
<script>
</script>
</style>.bg-colore{position: fixed;width: 100%;height: 100%;top: 0;left: 0;background-color: #f4f4f4;z-index: -1;
}<style>

实战-PC web登录页

实战-小程序登录页

<template><view class="container"> <image class="bg-img"  :src="imgSrc"></image><view class="content"></view></view>
</template>
<script>
export default {name: "index",data() {return {imgSrc: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-59f27697-00c5-4f1e-8c67-bb56e1e19e78/653c2495-cb7b-49a7-b6cb-f048e16fa5a7.jpg',}}}
</script>
<style>.bg-img {position: fixed;width: 100%;height: 100%;top: 0;left: 0;z-index: -1;}
</style>

vue设置页面背景及背景图片相关推荐

  1. vue设置页面滚动高度_vue 解决无法设置滚动位置的问题

    问题描述 在实现锚点定位的时候发现无法设置滚动条的位置. 在Vue中,使用 document.body.scrollTop=952 无法设置滚动条的高度. document.body.scrollTo ...

  2. vue设置页面的高度100%

    1.设置全局页面高度 在vuecli init的默认工程里面,App.vue 页面中加 //App.vue 页面中 <style>html,body,#app{height: 100%;b ...

  3. vue设置页面title

    vue默认的title是项目的名称,需要进行修改,有两种方法. 方法一: 在 ./public/index.html 文件中直接修改. 方法二: 可以根据单个页面设置title. 打开设置路由(rou ...

  4. vue 设置页面标题,微信公众号内嵌H5标题顶到顶部

    一.安装 npm install vue-meta -S 二.配置main.js import Meta from "vue-meta"; Vue.use(Meta); 三.页面配 ...

  5. vue设置页面标题title

    每个页面设置相同标题 index.html 直接修改title标签里面的标题 (ps: 这个html文件中也可以引入一些js文件) 每个页面设置不同标题 router - index.js const ...

  6. vue设置页面滚动高度_vue中获取滚动高度或指定滚动到某位置

    1.点击某个标签,滚动到某个具体位置 switchHeight(num) { this.selectNum = num; if (num == 0) { document.getElementById ...

  7. vue设置页面背景色

    mounted() {document.querySelector('body').setAttribute('style', 'background-color:#f6f6f6')},beforeD ...

  8. uni-app设置页面的背景图片

    可以通过设置view的background或者background-image属性来实现: <template><view class="content" :st ...

  9. Vue 设置背景图片样式

    Vue 设置背景图片样式 CSS 效果图 CSS <style> body{background-image: url('./bg.jpg');background-size: cover ...

最新文章

  1. 人脸识别屡遭非议 会成为“潘多拉魔盒”吗
  2. 企业防火墙之iptables
  3. gitbook的使用
  4. LeetCode-剑指 Offer 14- I. 剪绳子
  5. C++ number of positive divisors计算正除数的实现算法(附完整源码)
  6. VMware VIC
  7. Istio 1.10 发布及官网改版
  8. 解决 Idea 卡在 Resolving Maven dependencies ...
  9. 安卓dts音频解码_家庭影院三维音效技术应用之DTS:X摆位
  10. Lenovo Server Guide Install Windows Server 2008 R2
  11. 深度学习用于图像超分辨率重建综述——超分辨率(一)
  12. OSChina 周三乱弹 —— 致力于做一名优秀的女程序员鼓励师
  13. # TIG监控体系搭建
  14. java微信群自动回复_社群运营,你该如何选择一款好用的微信群管理工具?
  15. CASS10.1任意断面(渠道断面)土方计算
  16. 树莓派4B安装官方发布64位 Raspberry Pi OS 系统
  17. UIUX17个小技巧合集
  18. ismobile什么意思_Mobile是什么意思
  19. window server 2019 将服务器加入域控中
  20. 【原创】基于vue。简单、优雅的评论插件(包含颜文字表情、滑动验证)。

热门文章

  1. Mixed Content: The page at“https://xxx”was loaded over HTTPS, but requested an insecure
  2. .NET 开源框架在工业生产中的应用
  3. 树梅派QT运行海康工业相机 error while error while loading shared libraries: libMvCameraControl.so: cannot open
  4. sql server 中不等于<>、!=忽略了NULL的数据,怎么解决
  5. 第二章 名词词组与冠词
  6. 在web页面上快速生成二维码的三种实用方法
  7. java巡逻_巡逻命令的作用,
  8. python十个数排序_python基础练习--对10个数进行排序
  9. 我的第一条Java代码
  10. java flowlayout参数_【Java布局】FlowLayout布局时设定组件大小