2019-10-09 21:32:58 +00:00
|
|
|
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)
|
|
|
|
)
|
|
|
|
],
|
2019-10-09 21:32:58 +00:00
|
|
|
needRuntime: false
|
|
|
|
}
|
|
|
|
}
|