refactor: types refactor
This commit is contained in:
@@ -7,7 +7,7 @@ describe('2.x compat build', async () => {
|
||||
const root = document.createElement('div')
|
||||
document.body.appendChild(root)
|
||||
|
||||
const instance = new Vue({
|
||||
const instance = new Vue<any>({
|
||||
data() {
|
||||
return { count: 0 }
|
||||
},
|
||||
|
||||
@@ -6,13 +6,19 @@ import {
|
||||
ComponentOptions,
|
||||
createComponentInstance
|
||||
} from '@vue/renderer-dom'
|
||||
import { MergedComponent } from '../../core/src/component'
|
||||
|
||||
class Vue extends Component {
|
||||
class Vue<
|
||||
P extends object = {},
|
||||
D extends object = {},
|
||||
M extends object = {},
|
||||
C extends object = {}
|
||||
> extends Component {
|
||||
static h = h
|
||||
static render = render
|
||||
static nextTick = nextTick
|
||||
|
||||
constructor(options: ComponentOptions & { el?: any }) {
|
||||
constructor(options: ComponentOptions<P, D, M, C> & { el?: any }) {
|
||||
super()
|
||||
if (!options) {
|
||||
return
|
||||
@@ -43,5 +49,9 @@ class Vue extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
interface Vue<P, D, M, C> {
|
||||
$mount(el: any): MergedComponent<P, D> & M & C
|
||||
}
|
||||
|
||||
export default Vue
|
||||
export * from '@vue/renderer-dom'
|
||||
|
||||
Reference in New Issue
Block a user