Browse Source

use isObject

dev
Evan You 9 years ago
parent
commit
e30055eccd
  1. 3
      src/observer/index.js
  2. 4
      src/vdom/modules/class.js

3
src/observer/index.js

@ -3,6 +3,7 @@ import { arrayMethods } from './array'
import {
def,
isArray,
isObject,
isPlainObject,
hasProto,
hasOwn
@ -160,7 +161,7 @@ function copyAugment (target, src, keys) {
*/
export function observe (value, vm) {
if (!value || typeof value !== 'object') {
if (!isObject(value)) {
return
}
var ob

4
src/vdom/modules/class.js

@ -1,10 +1,10 @@
import { isArray, setClass } from '../../util/index'
import { isArray, isObject, setClass } from '../../util/index'
function genClass (data) {
if (!data) {
return ''
}
if (typeof data === 'object') {
if (isObject(data)) {
let res = ''
for (var key in data) {
if (data[key]) res += key + ' '

Loading…
Cancel
Save