فهرست منبع

Merge pull request #583 from QingWei-Li/feat/vue-template-whitespace

Feat/vue template whitespace
杨奕 8 سال پیش
والد
کامیت
588523e808
8فایلهای تغییر یافته به همراه16 افزوده شده و 13 حذف شده
  1. 1 0
      build/config.js
  2. 1 1
      build/cooking.common.js
  3. 1 0
      build/cooking.component.js
  4. 1 1
      build/cooking.conf.js
  5. 1 0
      build/cooking.demo.js
  6. 1 0
      build/cooking.test.js
  7. 2 2
      package.json
  8. 8 9
      src/utils/clickoutside.js

+ 1 - 0
build/config.js

@@ -13,6 +13,7 @@ Object.keys(dependencies).forEach(function(key) {
 });
 
 externals['element-ui/src/utils/clickoutside'] = 'element-ui/lib/utils/clickoutside';
+externals['element-ui/src/utils/date'] = 'element-ui/lib/utils/date';
 externals['element-ui/src/utils/popper'] = 'element-ui/lib/utils/popper';
 externals['element-ui/src/utils/vue-popper'] = 'element-ui/lib/utils/vue-popper';
 externals['element-ui/src/utils/resize-event'] = 'element-ui/lib/utils/resize-event';

+ 1 - 1
build/cooking.common.js

@@ -14,5 +14,5 @@ cooking.set({
 
 cooking.add('output.filename', 'element-ui.common.js');
 cooking.add('loader.js.exclude', config.jsexclude);
-
+cooking.add('vue.preserveWhitespace', false);
 module.exports = cooking.resolve();

+ 1 - 0
build/cooking.component.js

@@ -15,4 +15,5 @@ cooking.set({
 
 cooking.add('output.filename', '[name]/index.js');
 cooking.add('loader.js.exclude', config.jsexclude);
+cooking.add('vue.preserveWhitespace', false);
 module.exports = cooking.resolve();

+ 1 - 1
build/cooking.conf.js

@@ -14,5 +14,5 @@ cooking.set({
 
 cooking.add('output.filename', 'index.js');
 cooking.add('loader.js.exclude', config.jsexclude);
-
+cooking.add('vue.preserveWhitespace', false);
 module.exports = cooking.resolve();

+ 1 - 0
build/cooking.demo.js

@@ -91,4 +91,5 @@ if (process.env.NODE_ENV === 'production') {
   cooking.add('externals.vue-router', 'VueRouter');
 }
 
+cooking.add('vue.preserveWhitespace', false);
 module.exports = cooking.resolve();

+ 1 - 0
build/cooking.test.js

@@ -24,4 +24,5 @@ cooking.add('preLoader.0', {
 if (!process.env.CI_ENV) {
   cooking.add('plugins.process', new ProgressBarPlugin());
 }
+cooking.add('vue.preserveWhitespace', false);
 module.exports = cooking.resolve();

+ 2 - 2
package.json

@@ -99,8 +99,8 @@
     "theaterjs": "^3.0.0",
     "uppercamelcase": "^1.1.0",
     "url-loader": "^0.5.7",
-    "vue": "^2.0.2",
-    "vue-loader": "^9.5.1",
+    "vue": "^2.0.3",
+    "vue-loader": "^9.7.0",
     "vue-markdown-loader": "^0.5.1",
     "vue-router": "^2.0.0",
     "webpack": "^1.13.2",

+ 8 - 9
src/utils/clickoutside.js

@@ -45,15 +45,14 @@ export default {
   },
 
   unbind(el) {
-    nodeList.splice(el[ctx].id, 1);
-    delete el[ctx];
-  },
+    let len = nodeList.length;
 
-  install(Vue) {
-    /* istanbul ignore next */
-    Vue.directive('clickoutside', {
-      bind: this.bind,
-      unbind: this.unbind
-    });
+    for (let i = 0; i < len; i++) {
+      if (nodeList[i][ctx].id === el[ctx].id) {
+        nodeList.splice(i, 1);
+        delete el[ctx];
+        break;
+      }
+    }
   }
 };