Evan You пре 10 година
родитељ
комит
119286fb09

+ 1 - 1
examples/elastic-header/index.html

@@ -8,7 +8,7 @@
     <script src="http://dynamicsjs.com/lib/dynamics.js"></script>
     <link rel="stylesheet" href="style.css">
     <!-- template for the component -->
-    <script type="x/template" id="header-view-template">
+    <script type="text/x-template" id="header-view-template">
       <div class="draggable-header-view"
         @mousedown="startDrag" @touchstart="startDrag"
         @mousemove="onDrag" @touchmove="onDrag"

+ 2 - 2
examples/markdown/index.html

@@ -23,9 +23,9 @@
         },
         methods: {
           marked: marked,
-          update: function (e) {
+          update: _.debounce(function (e) {
             this.input = e.target.value
-          }
+          }, 300)
         }
       })
     </script>

+ 1 - 1
examples/select2/index.html

@@ -24,7 +24,7 @@
       </select2>
     </div>
 
-    <script type="x/template" id="select2-template">
+    <script type="text/x-template" id="select2-template">
       <select>
         <option v-if="placeholder"></option>
         <slot></slot>

+ 4 - 2
package.json

@@ -11,9 +11,10 @@
   ],
   "scripts": {
     "dev": "webpack --config build/webpack.config.js --watch",
-    "test": "mocha",
+    "test": "npm run e2e",
     "build": "NODE_ENV=production node build/build.js",
-    "lint": "eslint src"
+    "lint": "eslint src",
+    "e2e": "casperjs test --concise ./test/e2e"
   },
   "repository": {
     "type": "git",
@@ -34,6 +35,7 @@
     "babel-preset-es2015": "^6.0.0",
     "babel-preset-es2015-rollup": "^1.1.1",
     "babel-preset-stage-2": "^6.0.0",
+    "casperjs": "^1.1.0",
     "eslint": "^2.7.0",
     "eslint-config-standard": "^5.1.0",
     "eslint-loader": "^1.3.0",

+ 4 - 2
src/runtime/instance/state.js

@@ -38,8 +38,10 @@ function initProps (vm) {
 export function getPropValue (data, key) {
   if (!data) return
   const altKey = hyphenate(key)
-  return getPropValueFromHash(data.attrs, key, altKey) ||
-    getPropValueFromHash(data.props, key, altKey)
+  const attrVal = getPropValueFromHash(data.attrs, key, altKey)
+  return attrVal === undefined
+    ? getPropValueFromHash(data.props, key, altKey)
+    : attrVal
 }
 
 function getPropValueFromHash (hash, key, altKey) {

+ 1 - 0
src/runtime/vdom/modules/attrs.js

@@ -27,6 +27,7 @@ function updateAttrs (oldVnode, vnode) {
       if (booleanAttrsDict[key] && cur == null) {
         elm.removeAttribute(key)
       } else {
+        if (!cur) debugger
         elm.setAttribute(key, cur)
       }
     }