Просмотр исходного кода

Some improvements for "Modal" example (#2754)

* Rename CSS file to match with other examples

* Merge script tags
Phan An 10 лет назад
Родитель
Сommit
8e34f455ad
2 измененных файлов с 7 добавлено и 9 удалено
  1. 6 8
      examples/modal/index.html
  2. 1 1
      examples/modal/style.css

+ 6 - 8
examples/modal/index.html

@@ -4,7 +4,7 @@
     <meta charset="utf-8">
     <title>Vue.js Modal Example</title>
     <script src="../../dist/vue.js"></script>
-    <link rel="stylesheet" href="modal.css">
+    <link rel="stylesheet" href="style.css">
   </head>
   <body>
     <!-- template for the modal component -->
@@ -38,13 +38,6 @@
       </div>
     </script>
 
-    <script>
-      // register modal component
-      Vue.component('modal', {
-        template: '#modal-template'
-      })
-    </script>
-
     <!-- app -->
     <div id="app">
       <button id="show-modal" @click="showModal = true">Show Modal</button>
@@ -59,6 +52,11 @@
     </div>
 
     <script>
+      // register modal component
+      Vue.component('modal', {
+        template: '#modal-template'
+      })
+
       // start app
       new Vue({
         el: '#app',

+ 1 - 1
examples/modal/modal.css → examples/modal/style.css

@@ -40,7 +40,7 @@
 }
 
 /*
- * the following styles are auto-applied to elements with
+ * The following styles are auto-applied to elements with
  * transition="modal" when their visibility is toggled
  * by Vue.js.
  *