Evan You 9 years ago
parent
commit
c11a706bbf
  1. 2
      src/compiler/codegen/directives/index.js
  2. 8
      src/compiler/codegen/directives/text.js

2
src/compiler/codegen/directives/index.js

@ -1,5 +1,6 @@
import { model } from './model'
import { show } from './show'
import { text } from './text'
import { html } from './html'
import { ref } from './ref'
export { genHandlers } from './on'
@ -7,6 +8,7 @@ export { genHandlers } from './on'
export const directives = {
model,
show,
text,
html,
ref,
cloak: function () {} // noop

8
src/compiler/codegen/directives/text.js

@ -0,0 +1,8 @@
export function text (el, dir) {
if (!dir.value) return
if (!el.props) el.props = []
el.props.push({
name: 'textContent',
value: `__toString__(${dir.value})`
})
}
Loading…
Cancel
Save