Ver Fonte

fix #695 `name` option should be inherited for constructor name

Evan You há 11 anos atrás
pai
commit
69b9f0f607
1 ficheiros alterados com 5 adições e 1 exclusões
  1. 5 1
      src/api/global.js

+ 5 - 1
src/api/global.js

@@ -40,7 +40,11 @@ var cid = 1
 exports.extend = function (extendOptions) {
   extendOptions = extendOptions || {}
   var Super = this
-  var Sub = createClass(extendOptions.name || 'VueComponent')
+  var Sub = createClass(
+    extendOptions.name ||
+    Super.options.name ||
+    'VueComponent'
+  )
   Sub.prototype = Object.create(Super.prototype)
   Sub.prototype.constructor = Sub
   Sub.cid = cid++