Browse Source

增加背景图

Limengbo 6 years ago
parent
commit
9e81e884dd
3 changed files with 6 additions and 65 deletions
  1. 0 62
      README.md
  2. BIN
      src/assets/bg.jpg
  3. 6 3
      src/views/login/index.vue

File diff suppressed because it is too large
+ 0 - 62
README.md


BIN
src/assets/bg.jpg


+ 6 - 3
src/views/login/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="login-container">
+  <div :style="bg" class="login-container">
     <div class="code">
       <span>微信扫一扫登录</span>
       <img :src="code" class="code-img">
@@ -17,7 +17,10 @@ export default {
     return {
       loading: false,
       pwdType: 'password',
-      redirect: undefined
+      redirect: undefined,
+      bg: {
+        backgroundImage: 'url(' + require('@/assets/bg.jpg') + ')'
+      }
     }
   },
   computed: {
@@ -98,7 +101,7 @@ $light_gray:#eee;
   position: fixed;
   height: 100%;
   width: 100%;
-  background-color: $bg;
+  background-size: 100% 100%;
   .login-form {
     position: absolute;
     left: 0;