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

18 lines
365 B
TypeScript
Raw Normal View History

import {
DirectiveTransform,
createObjectProperty,
createSimpleExpression
} from '@vue/compiler-core'
export const transformOnce: DirectiveTransform = dir => {
return {
2019-10-10 22:02:51 +00:00
props: [
createObjectProperty(
createSimpleExpression(`$once`, true, dir.loc),
createSimpleExpression('true', false)
)
],
needRuntime: false
}
}