# 1. 建立存放設定的目錄
New-Item -ItemType Directory -Force -Path $env:LOCALAPPDATA\nvim\lua\plugins
# 2. 下載 lazy.nvim 到標準資料套件庫路徑
git clone https://github.com $env:LOCALAPPDATA\nvim\lazy\lazy.nvim
:checkhealth lazy
:Lazy sync
# 1. 建立存放設定的目錄
New-Item -ItemType Directory -Force -Path $env:LOCALAPPDATA\nvim\lua\plugins
# 2. 下載 lazy.nvim 到標準資料套件庫路徑
git clone https://github.com $env:LOCALAPPDATA\nvim\lazy\lazy.nvim
:checkhealth lazy
:Lazy sync
// 抓取所有標籤
/<!([^]{0,}?)>|<([a-z][^]{0,}?)(?:\s[^]{0,}?|)([\/]?)>|<\/([a-z][^]{0,}?)>/sg
-------------------------------
// 抓取有 attr 的標籤
// 可以避免 <script> 內容的干擾
// 先試圖抓取有問題的標籤 <script>...</script>
/<script(|\s.*?)>.*?<\/script>|(?<=<[^/][^\/>\s]+)(\s[^\/>]+)(?=\/?>)/gs;
prop 完善
state ------ objProxy listener test(找機會再測試)
view.msg(把錯誤資料綁定在 observer 上)
----------------------
tempale.bracket
(注意 html load 順序)
view manager
如何匯入不同的 viewModule
----------------------
view.bracket
view.loader
(注意 html load 順序)
----------------------
view.watch(用 onCommited 取代)
不要依次用 watch 發射 event
----------------------
form 的修改,
大多採用舊的簡易 prototype 避免麻煩
尤其是id 設置方式
(根據主要資料 id, attr-name)混合
沒有 id ,或撞 id 則不用 cache
form.focus
記錄 foucusin,然後 form 設置在 callback_onCommited
----------------------
form 測試
----------------------
template static
----------------------
view.template.setting 完善
template.server 的設定最晚弄
view.loading 測試
model.init
model.store ???
測試 workerMnanger 正不正確
----------------------
測試 view compile by server (用 iframe 比較簡單)
array.slice() 會造成 ob 有多個 parent
必須在 [....].set 時候做檢查 data.ob 是否有 parent
若有則返回一個乾淨的 data
array.slice()的結果跟預設不同
內部的 item 指向不同物件
https://github.com/developit/htm
取代 jsx
使用 htm (最推薦的字串替代方案)
如果你覺得 React.createElement 太難讀,開發者常用的方案是 htm。它利用 ES6 的樣版字串 (Template Literals),讓你能在瀏覽器中直接執行類似 JSX 的語法,完全不需要編譯。
你可以直接透過 CDN 引入,適合快速原型開發:
HTML
<script type="module">
import { h, render } from 'https://esm.sh/preact';
import htm from 'https://esm.sh/htm';
// 初始化 htm
const html = htm.bind(h);
function App (props) {
return html`<h1>Hello ${props.name}!</h1>`;
}
render(html`<${App} name="World" />`, document.body);
</script>
import { createRequire } from 'module';
const require = createRequire((import.meta.url);