We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3486df commit b9df7f1Copy full SHA for b9df7f1
src/guide/scaling-up/ssr.md
@@ -309,14 +309,17 @@ Since most custom directives involve direct DOM manipulation, they are ignored d
309
310
```js
311
const myDirective = {
312
- mounted(el) {
313
- el.id = 'foo'
+ mounted(el, binding) {
+ // client-side implementation:
314
+ // directly update the DOM
315
+ el.id = binding.value
316
},
- getSSRProps(binding, vnode) {
- // the hook is passed the directive binding and the element vnode.
317
- // return props to be added to the vnode.
+ getSSRProps(binding) {
318
+ // server-side implementation:
319
+ // return the props to be rendered.
320
+ // getSSRProps only receives the directive binding.
321
return {
- id: 'foo'
322
+ id: binding.value
323
}
324
325
0 commit comments