通過 npm 或者 CDN 獲取:
npm i cax
import cax from 'cax'
const stage = new cax.Stage(200, 200, '#renderTo')
const rect = new cax.Rect(100, 100, {
fillStyle: 'black'
})
stage.add(rect)
stage.update()
除了 Stage 構造函數(shù)比小程序第四個參數(shù) this
,其他使用方式都一樣。
更多建議: