-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into add-css-module
- Loading branch information
Showing
24 changed files
with
151 additions
and
124 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 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 |
---|---|---|
@@ -1,22 +1,23 @@ | ||
import Vue from 'vue' | ||
import { currentVM, getCurrentVue } from './runtimeContext' | ||
import { defineComponentInstance } from './helper' | ||
import { warn } from './utils' | ||
import { getVueConstructor, getCurrentInstance } from '../runtimeContext' | ||
import { defineComponentInstance } from '../utils/helper' | ||
import { warn } from '../utils' | ||
|
||
type CreateElement = Vue['$createElement'] | ||
|
||
let fallbackCreateElement: CreateElement | ||
|
||
export const createElement = (function createElement(...args: any) { | ||
if (!currentVM) { | ||
const instance = getCurrentInstance() | ||
if (!instance) { | ||
warn('`createElement()` has been called outside of render function.') | ||
if (!fallbackCreateElement) { | ||
fallbackCreateElement = defineComponentInstance(getCurrentVue()) | ||
fallbackCreateElement = defineComponentInstance(getVueConstructor()) | ||
.$createElement | ||
} | ||
|
||
return fallbackCreateElement.apply(fallbackCreateElement, args) | ||
} | ||
|
||
return currentVM.$createElement.apply(currentVM, args) | ||
return instance.$createElement.apply(instance, args) | ||
} as any) as CreateElement |
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,8 @@ | ||
export * from './state' | ||
export * from './lifecycle' | ||
export * from './watch' | ||
export * from './computed' | ||
export * from './inject' | ||
export { createApp } from './createApp' | ||
export { nextTick } from './nextTick' | ||
export { createElement as h } from './createElement' |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import Vue from 'vue' | ||
import { currentVue } from './runtimeContext' | ||
import { getVueConstructor } from '../runtimeContext' | ||
|
||
type NextTick = Vue['$nextTick'] | ||
|
||
export const nextTick: NextTick = function nextTick( | ||
this: ThisType<NextTick>, | ||
...args: Parameters<NextTick> | ||
) { | ||
return currentVue?.nextTick.apply(this, args) | ||
return getVueConstructor()?.nextTick.apply(this, args) | ||
} as any |
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,17 +1,18 @@ | ||
export { | ||
isReactive, | ||
isRef, | ||
markRaw, | ||
markReactive, | ||
reactive, | ||
ref, | ||
Ref, | ||
isRef, | ||
toRefs, | ||
set, | ||
toRef, | ||
isReactive, | ||
UnwrapRef, | ||
markRaw, | ||
unref, | ||
shallowReactive, | ||
toRaw, | ||
shallowRef, | ||
toRaw, | ||
toRef, | ||
toRefs, | ||
triggerRef, | ||
unref, | ||
UnwrapRef, | ||
} from '../reactivity' |
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
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
Oops, something went wrong.