Bladeren bron

页面优化

MS-CIAZDCOIXVRW\Administrator 3 jaren geleden
bovenliggende
commit
4c0275b7f9
7 gewijzigde bestanden met toevoegingen van 382 en 495 verwijderingen
  1. BIN
      public/favicon.ico
  2. BIN
      src/assets/1.jpg
  3. BIN
      src/assets/2.jpg
  4. BIN
      src/assets/backImg.png
  5. 365 485
      src/components/CarRecord.vue
  6. 14 0
      src/main.js
  7. 3 10
      vue.config.js

BIN
public/favicon.ico


BIN
src/assets/1.jpg


BIN
src/assets/2.jpg


BIN
src/assets/backImg.png


File diff suppressed because it is too large
+ 365 - 485
src/components/CarRecord.vue


+ 14 - 0
src/main.js

@@ -11,6 +11,20 @@ Vue.prototype.$axios = axios
 
 
 Vue.config.productionTip = false
 Vue.config.productionTip = false
 
 
+// 注册 表格滚动底部指令
+Vue.directive('moretable', {
+  bind(el, binding) {
+    // 获取element-ui定义好的scroll盒子 表格滚动底部事件
+    const TABLE_DOM = el.querySelector('.el-table__body-wrapper')
+    TABLE_DOM.addEventListener('scroll', function () {
+      const CONDITIONVALUE = this.scrollHeight - this.scrollTop <= this.clientHeight
+      if (CONDITIONVALUE) {
+        binding.value()
+      }
+    })
+  }
+})
+
 new Vue({
 new Vue({
   render: h => h(App),
   render: h => h(App),
 }).$mount('#app')
 }).$mount('#app')

+ 3 - 10
vue.config.js

@@ -4,21 +4,14 @@ module.exports = {
     publicPath: './',
     publicPath: './',
     devServer: {
     devServer: {
         open: true,
         open: true,
-        host: 'localhost',
-        port: 8080,
-        https: false,
-        //以上的ip和端口是我们本机的;下面为需要跨域的
-        proxy: {//配置跨域
+        proxy: {
             '/car-record-api': {
             '/car-record-api': {
                 target: 'http://127.0.0.1:8280',
                 target: 'http://127.0.0.1:8280',
-                //这里后台的地址模拟的;应该填写你们真实的后台接口
-                ws: true,
-                changOrigin: true,//允许跨域
+                changOrigin: true,
                 pathRewrite: {
                 pathRewrite: {
-                    '^/car-record-api': ''//请求的时候使用这个api就可以
+                    '^/car-record-api': ''
                 }
                 }
             }
             }
-
         }
         }
     }
     }
 }
 }