vue3-yuanma/packages/compiler-core/src/transforms/vOnce.ts

16 lines
345 B
TypeScript
Raw Normal View History

import {
DirectiveTransform,
createObjectProperty,
createSimpleExpression
} from '@vue/compiler-core'
export const transformOnce: DirectiveTransform = dir => {
return {
props: createObjectProperty(
createSimpleExpression(`$once`, true, dir.loc),
createSimpleExpression('true', false)
),
needRuntime: false
}
}