-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
1,214 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ import Vue from './runtime/index' | |
|
||
export default Vue | ||
|
||
export * from 'vca/index' | ||
export * from 'v3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ import Vue from './runtime-with-compiler' | |
|
||
export default Vue | ||
|
||
export * from 'vca/index' | ||
export * from 'v3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import Vue from './runtime-with-compiler' | ||
import * as vca from 'vca/index' | ||
import * as vca from 'v3' | ||
import { extend } from 'shared/util' | ||
|
||
extend(Vue, vca) | ||
|
||
import { effect } from 'vca/reactivity/effect' | ||
import { effect } from 'v3/reactivity/effect' | ||
Vue.effect = effect | ||
|
||
export default Vue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Component } from 'typescript/component' | ||
|
||
export let currentInstance: Component | null = null | ||
|
||
/** | ||
* This is exposed for compatibility with v3 (e.g. some functions in VueUse | ||
* relies on it). Do not use this internally, just use `currentInstance`. | ||
* | ||
* @private this function needs manual type declaration because it relies | ||
* on previously manually authored types from Vue 2 | ||
*/ | ||
export function getCurrentInstance(): { proxy: Component } | null { | ||
return currentInstance && { proxy: currentInstance } | ||
} | ||
|
||
/** | ||
* @private | ||
*/ | ||
export function setCurrentInstance(vm: Component | null) { | ||
currentInstance = vm | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { createElement } from '../core/vdom/create-element' | ||
import VNode from 'core/vdom/vnode' | ||
import { VNodeData, VNodeChildren } from 'typescript/vnode' | ||
import { currentInstance } from './currentInstance' | ||
import { warn } from 'core/util' | ||
|
||
/** | ||
* @private this function needs manual type declaration because it relies | ||
* on previously manually authored types from Vue 2 | ||
*/ | ||
export function h(type: any, children?: VNodeChildren): VNode | ||
export function h( | ||
type: any, | ||
props?: VNodeData | null, | ||
children?: VNodeChildren | ||
): VNode | ||
|
||
export function h(type: any, props?: any, children?: any) { | ||
if (!currentInstance) { | ||
__DEV__ && | ||
warn( | ||
`globally imported h() can only be invoked when there is an active ` + | ||
`component instance, e.g. synchronously in a component's render or setup function.` | ||
) | ||
} | ||
return createElement(currentInstance!, type, props, children, 2, true) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.