feat(core): support v-show directive (#310)
This commit is contained in:
@@ -1 +1,17 @@
|
||||
// TODO
|
||||
import { DirectiveTransform } from '@vue/compiler-core'
|
||||
import { createDOMCompilerError, DOMErrorCodes } from '../errors'
|
||||
import { V_SHOW } from '../runtimeHelpers'
|
||||
|
||||
export const transformShow: DirectiveTransform = (dir, node, context) => {
|
||||
const { exp, loc } = dir
|
||||
if (!exp) {
|
||||
context.onError(
|
||||
createDOMCompilerError(DOMErrorCodes.X_V_SHOW_NO_EXPRESSION, loc)
|
||||
)
|
||||
}
|
||||
|
||||
return {
|
||||
props: [],
|
||||
needRuntime: context.helper(V_SHOW)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user