소스 검색

feat(core options / config)

Ryan Chandler 5 년 전
부모
커밋
d2b798b0bc
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      src/index.js

+ 8 - 0
src/index.js

@@ -2,6 +2,10 @@ import { domReady, buildInitExpression } from './utils'
 import { createObservable } from './observable'
 
 const Spruce = {
+    options: {
+        globalStoreVariable: false,
+    },
+
     stores: {},
 
     subscribers: [],
@@ -37,6 +41,10 @@ const Spruce = {
                 el.__x.$data.spruce = [key, value]
             }
         })
+    },
+
+    config(options = {}) {
+        this.options = Object.assign(this.options, options)
     }
 }