@knowlearning/agents 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/vue/3/component.js +10 -10
package/package.json
CHANGED
package/vue/3/component.js
CHANGED
|
@@ -8,9 +8,9 @@ function isScopeSerializable(v) {
|
|
|
8
8
|
)
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export default async function (module) {
|
|
11
|
+
export default async function (module, props) {
|
|
12
12
|
const component = module.default ? { ...module.default } : { ...module } // copy component since we will mess with mounted and data functions
|
|
13
|
-
|
|
13
|
+
/*
|
|
14
14
|
if (!component.ephemeral) {
|
|
15
15
|
const state = await Agent.mutate()
|
|
16
16
|
|
|
@@ -28,14 +28,12 @@ export default async function (module) {
|
|
|
28
28
|
const origSetupFn = component.setup
|
|
29
29
|
const isReactiveRef = r => r && r.__v_isRef
|
|
30
30
|
component.setup = function setupProxy(a, b) { // need to specifically add this here, otherwise second argument not passed in arguments array (probably because of webpack optimization...)
|
|
31
|
-
|
|
31
|
+
let refs = origSetupFn.call(this, a, b)
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
.forEach(([k, v]) => refs[k].value = v)
|
|
38
|
-
}
|
|
33
|
+
Object
|
|
34
|
+
.entries(state)
|
|
35
|
+
.filter(([k]) => isReactiveRef(refs[k]))
|
|
36
|
+
.forEach(([k, v]) => refs[k].value = v)
|
|
39
37
|
|
|
40
38
|
Object
|
|
41
39
|
.entries(refs)
|
|
@@ -52,9 +50,11 @@ export default async function (module) {
|
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
52
|
}
|
|
53
|
+
*/
|
|
55
54
|
|
|
56
55
|
document.body.innerHTML = ''
|
|
57
|
-
const app = createApp(component)
|
|
56
|
+
const app = createApp(component, props)
|
|
57
|
+
console.log(app)
|
|
58
58
|
app.component('Content', content)
|
|
59
59
|
app.mount(document.body)
|
|
60
60
|
}
|