Skip to content

Commit 58ccd05

Browse files
committed
a
1 parent ca4dcf3 commit 58ccd05

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-facing-decorator",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Vue typescript class and decorator based component.",
55
"main": "dist/index.js",
66
"keywords": [

src/component.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineComponent, ComponentCustomOptions } from 'vue';
2-
import { obtainSlot, getSuperSlot } from './utils'
2+
import { obtainSlot, getSuperSlot, getSlot } from './utils'
33
import { build as optionComputed } from './option/computed'
44
import { build as optionData } from './option/data'
55
import { build as optionMethodsAndLifecycle } from './option/methodsAndLifecycle'
@@ -103,22 +103,35 @@ function build(cons: Cons, option: ComponentOption) {
103103
}
104104
function _Component(arg: ComponentConsOption, cb: (cons: Cons, option: ComponentOption) => any) {
105105
if (typeof arg === 'function') {
106+
console.log('zxzxzx A')
106107
return cb(arg, {})
107108
}
109+
console.log('zxzxzx B')
108110
return function (cons: Cons) {
111+
console.log('zxzxzx C')
109112
return cb(cons, arg)
110113
}
111114
}
112115
export function ComponentBase(arg: ComponentConsOption): any {
113116
return _Component(arg, function (cons: Cons, option: ComponentOption) {
117+
console.log('zxzxzx D')
114118
build(cons, option)
115119
return cons
116120
})
117121
}
118122

119123
export function Component(arg: ComponentConsOption): any {
124+
console.log('zxzxzx', arg)
120125
return _Component(arg, function (cons: Cons, option: ComponentOption) {
126+
console.log('zxzxzx 2')
121127
build(cons, option)
128+
// const slot = getSlot(cons.prototype)!
129+
// Object.defineProperty(cons, '__vccOpts', {
130+
// value: slot.cachedVueComponent
131+
// })
132+
// console.log('kkkk', '__vccOpts' in cons, cons)
133+
// return cons
122134
return obtainSlot(cons.prototype).cachedVueComponent
123135
})
136+
124137
}

0 commit comments

Comments
 (0)