2026年3月26日 星期四

要注意測試的地方 array.slice()

 array.slice() 會造成 ob 有多個 parent

必須在 [....].set 時候做檢查 data.ob 是否有 parent

若有則返回一個乾淨的 data

array.slice()的結果跟預設不同

內部的 item 指向不同物件 

2026年2月26日 星期四

取代 jsx

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> 

2025年12月25日 星期四

代辦

request 

template.bracket 

 get tempalte by request

資料庫 

view.onValidate

view.onComputeData

form.select 測試

view.loading 

-----------------------------------------

做到 isDataChange

emit_1() 

callByProxy_1() 

 

 

鼻病藥方

114/12/25 

 辛夷散: 4*7,  防風: 1*7,  小青龍湯: 4*7,  魚腥草: 1*7,  白芷: 1*7,  枇杷:1*7,  川貝:??      

 

2025年10月14日 星期二

module 使用 require

 import { createRequire } from 'module';
const require = createRequire((import.meta.url);

2025年5月5日 星期一

visual studio code keymap

 [
    {
        "key": "alt+oem_2",
        "command": "editor.action.triggerSuggest",
        "when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
    },
    {
        "key": "ctrl+space",
        "command": "-editor.action.triggerSuggest",
        "when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
    },
    {
        "key": "ctrl+backspace",
        "command": "-deleteWordLeft",
        "when": "textInputFocus && !editorReadonly"
    },
    {
        "key": "ctrl+space",
        "command": "-toggleSuggestionDetails",
        "when": "suggestWidgetVisible && textInputFocus"
    }
]