Evan You %!s(int64=10) %!d(string=hai) anos
pai
achega
c11a706bbf

+ 2 - 0
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 - 0
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})`
+  })
+}