Browse Source

perf:refine code

Pan 7 years ago
parent
commit
a17c1eb206
2 changed files with 8 additions and 2 deletions
  1. 1 1
      index.html
  2. 7 1
      src/views/form/index.vue

+ 1 - 1
index.html

2
 <html>
2
 <html>
3
   <head>
3
   <head>
4
     <meta charset="utf-8">
4
     <meta charset="utf-8">
5
-    <title>vue-admin</title>
5
+    <title>vue-admin-template</title>
6
   </head>
6
   </head>
7
   <body>
7
   <body>
8
     <div id="app"></div>
8
     <div id="app"></div>

+ 7 - 1
src/views/form/index.vue

41
       </el-form-item>
41
       </el-form-item>
42
       <el-form-item>
42
       <el-form-item>
43
         <el-button type="primary" @click="onSubmit">Create</el-button>
43
         <el-button type="primary" @click="onSubmit">Create</el-button>
44
-        <el-button>Cancel</el-button>
44
+        <el-button @click="onCancel">Cancel</el-button>
45
       </el-form-item>
45
       </el-form-item>
46
     </el-form>
46
     </el-form>
47
   </div>
47
   </div>
66
   methods: {
66
   methods: {
67
     onSubmit() {
67
     onSubmit() {
68
       this.$message('submit!')
68
       this.$message('submit!')
69
+    },
70
+    onCancel() {
71
+      this.$message({
72
+        message: 'cancel!',
73
+        type: 'warning'
74
+      })
69
     }
75
     }
70
   }
76
   }
71
 }
77
 }