已棄用 API
本頁列出原始碼標註預計於 2.x 版移除、目前仍可使用的舊名稱與舊選項,以及對應的新寫法。
全域類別別名
| 舊名稱 | 改用 | 註記 |
|---|---|---|
PDMarkdownEditor |
MDEditor |
原始碼標註「2.0.0 棄用」 |
PDMarkdownViewer |
MDViewer |
同上 |
兩組名稱指向同一個類別,行為完全相同。
MDEditor 方法
舊方法都直接轉呼叫新方法:
| 舊方法 | 改用 |
|---|---|
goBack() |
undo() |
goForward() |
redo() |
addHeading(event, num) |
heading(event, num) |
addBold(event) |
bold(event) |
addItalic(event) |
italic(event) |
addStrikethrough(event) |
strikethrough(event) |
addUnderline(event) |
underline(event) |
addMarker(event) |
marker(event) |
addSup(event) |
sup(event) |
addSub(event) |
sub(event) |
addCode(event) |
code(event) |
addBlockquote() |
blockquote() |
addUl() |
ul() |
addOl() |
ol() |
addLink(title, href) |
link(title, href) |
addImage(src, alt, title) |
image(src, alt, title) |
downloadMd() |
download("md") |
downloadHtml() |
download("html") |
getTxt() |
text 屬性 |
MDEditor 頂層選項
| 舊選項 | 改用 |
|---|---|
mode |
style.mode |
fillMode |
style.fill |
showRow |
style.showRow |
fontFamily |
style.fontFamily |
focusBackgroundColor |
style.focus.backgroundColor |
focusTextColor |
style.focus.color |
placeholder(字串) |
style.placeholder.text |
placeholderColor |
style.placeholder.color |
舊選項存在時會覆蓋 style 中的對應值,因為它們在後面套用。
MDViewer 頂層選項
| 舊選項 | 改用 |
|---|---|
pre |
emptyContent |
fillMode |
style.fill |
delay |
sync.delay |
scrollSync |
sync.scroll |
fontFamily |
style.fontFamily(舊選項為空時預設 'Noto Sans TC', sans-serif) |
tagPath |
hashtag.path |
tagTarget |
hashtag.target |
emptyContent 與 pre 同時存在時以 emptyContent 為準。
已移除的 API
目前沒有已移除的公開 API;上述名稱都仍在 v1.11.6 中運作。