diff options
Diffstat (limited to 'vue-notes.md')
-rw-r--r-- | vue-notes.md | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/vue-notes.md b/vue-notes.md index 7295e70..1c96655 100644 --- a/vue-notes.md +++ b/vue-notes.md @@ -63,10 +63,12 @@ In addition to those objects: ahead-of-time as a server-side optimization step before being served to the client, or it can happen at runtime by calling `Vue.compile("template string")`, which returns a function. - Anyway, having render functions exposed to programmers means that, - if you want, you can write the render functions yourself, instead - of writing templates. Programmers coming from React will note that - JSX is useful for writing render functions. + Actually, the compiler returns a `render` function *and* a set of + `staticRenderFns` helpers. Anyway, having render functions exposed + to programmers means that, if you want, you can write the render + functions yourself, instead of writing templates. Programmers + coming from React will note that JSX is useful for writing render + functions. Tying it together: A *component* is mostly just a *Vue instance* that manages its part of the DOM by calling a *render function* (compiled @@ -250,6 +252,30 @@ differences. - Rollup (`rollup-plugin-vue`): TODO +The resulting JS module does 2 things: + - Inject global CSS in to the page (at module load) + * vue-loader: TODO + * vueify: `require("vueify/lib/insert-css").insert("CSS-string")` + * rollup-plugin-vue: TODO + - Export an object suitable to pass to `Vue.component()`; either a + raw `Object`, or a `Vue.extend()`-blessed object (which has type + `Function`) + + This is mostly is up to you, exporting it in the `<script>` + element. However, this obviously doesn't include the template. + How does it inject the template in to the object you export, when + there are (1) multiple object formats that you can export, and (2) + multiple module syntaxes that you can use to export it? + * vue-loader: TODO + * vueify: (2) Assume Node module syntax (CommonJS-ish), and (2) + set: + + var tmp_options = typeof module.exports === "function" ? module.exports.options : module.exports; + tmp_options.render = function() { ... }; + tmp_options.staticRenderFns = ...; + + * rollup-plugin-vue: TODO + # misc Components don't work by literally registering custom elements with |