[Improvement] Support Vue.use to register a component (#401)

This commit is contained in:
neverland
2017-12-11 20:41:19 +08:00
committed by GitHub
parent 7dbb5db256
commit 6f2b4c99da
162 changed files with 432 additions and 490 deletions

View File

@@ -1,4 +1,6 @@
const hasOwnProperty = Object.prototype.hasOwnProperty;
import { isDef } from './';
const { hasOwnProperty } = Object.prototype;
function isObj(x) {
const type = typeof x;
@@ -8,12 +10,7 @@ function isObj(x) {
function assignKey(to, from, key) {
const val = from[key];
if (
val === undefined ||
val === null ||
(hasOwnProperty.call(to, key) &&
(to[key] === undefined || to[key] === null))
) {
if (!isDef(val) || (hasOwnProperty.call(to, key) && !isDef(to[key]))) {
return;
}