js_vue
Vite
https://vitejs.dev/guide/why.html
https://vitejs.dev/guide/
README.md: @builtin vscode.typescript-language-features
-> Disable (Workspace)
| install vue.volar
+ Vue.vscode-typescript-vue-plugin
V3
Live try HTML/SFC: https://vuejs.org/tutorial/
2to3
https://vuejsdevelopers.com/2020/03/16/vue-js-tutorial/
new Vue()
====>createApp()
data: {
====>data: () => ({
render: h => h(App)
====>App
multi
<>
under<template>
setup()
: no.value
andthis
: https://vuejs.org/api/composition-api-setup.htmlTeleport:
<Teleport to="body/#id">
: https://vuejs.org/guide/built-ins/teleport.html
createApp
源码 - ensureRenderer: https://vue3js.cn/global/createApp.html
https://vuejs.org/api/application.html#createapp
hydration mode
https://vuejs.org/guide/scaling-up/ssr.html#client-hydration
make the client-side app interactive: use createSSRApp() instead of createApp()
shared between the server and the client - universal code:
Components
.vue - Single-File Component/SFC | no CDN: https://vuejs.org/guide/essentials/component-basics.html
defineComponent
defineCustomElement
Plugins
https://vuejs.org/guide/reusability/plugins.html
Routing
https://vuejs.org/guide/scaling-up/routing.html
VNode - h()
https://vuejs.org/guide/extras/render-function.html
Data Binding
v-bind/on
v-bind: https://vuejs.org/guide/essentials/template-syntax.html#dynamically-binding-multiple-attributes
v-bind : 1-way v-model: 2-way = v-bind + v-on
Event
https://vuejs.org/tutorial/#step-4
SFC Demo: https://github.com/fzinfz/test-vue3-ts-vite/commit/3b06a86c4c894436c47c33f584337fe789c5e6d0
Watch
https://vuejs.org/guide/essentials/watchers.html
HTML Demo: https://github.com/fzinfz/scripts/commit/846a0bb2260a92ed9d76fd24f6669e8c63f15fde
computed
for complex logic that includes reactive data:https://vuejs.org/guide/essentials/computed.html
refs
https://vuejs.org/guide/essentials/template-refs.html
List Rendering
https://v3.vuejs.org/guide/list.html
lifecycle
https://v3.vuejs.org/guide/instance.html#creating-an-application-instance
Code Snippets
str(lines) -> html(links): https://github.com/fzinfz/fzinfz.github.io/blob/master/i/index.html
Last updated