lrf402788946 5 years ago
parent
commit
782bea8a5e
1 changed files with 8 additions and 7 deletions
  1. 8 7
      layout/admin/list-frame.vue

+ 8 - 7
layout/admin/list-frame.vue

@@ -5,13 +5,7 @@
         <el-row>
           <el-col :span="21" class="title">
             <span v-if="returns">
-              <el-button
-                size="mini"
-                plan
-                circle
-                @click="$router.push({ path: returns })"
-                style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)"
-              >
+              <el-button size="mini" plan circle @click="toReturns" style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)">
                 <span class="el-icon-arrow-left" style="zoom:1.5;font-weight:700"></span>
               </el-button>
             </span>
@@ -103,6 +97,13 @@ export default {
       for (const key of keys) if (this.searchInfo[key] === '' || !this.searchInfo[key]) delete this.searchInfo[key];
       this.$emit('query', this.searchInfo);
     },
+    toReturns() {
+      if (_.isString(this.returns)) this.$router.push({ path: this.returns });
+      else if (_.isFunction(this.returns)) {
+        let fun = _.get(this, `returns`);
+        fun();
+      }
+    },
   },
 };
 </script>