mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
feat: DEMO 模式支持展示嵌入的表格
This commit is contained in:
+1
-1
@@ -333,7 +333,7 @@ xml 代码块 第一行注释需要有 `--drawio--` 文字
|
||||
链接属性 `link-type` 值需要是 `luckysheet` 字符串。使用链接的形式也不会影响其他 Markdown 解析器解析。
|
||||
|
||||
```markdown
|
||||
[drawio](./test.luckysheet){link-type="luckysheet"}
|
||||
[luckysheet](./test.luckysheet){link-type="luckysheet"}
|
||||
```
|
||||
|
||||
## 快捷键
|
||||
|
||||
@@ -13,6 +13,7 @@ import * as api from '@fe/support/api'
|
||||
import { refreshTree } from '@fe/context/tree'
|
||||
import { buildSrc, IFrame } from '@fe/context/embed'
|
||||
import Mask from '@fe/components/Mask.vue'
|
||||
import { FLAG_DEMO } from '@fe/support/global-args'
|
||||
|
||||
const logger = getLogger('plugin-markdown-luckysheet')
|
||||
|
||||
@@ -239,6 +240,20 @@ const LuckyComponent = defineComponent({
|
||||
|
||||
watch(props, update, { immediate: true })
|
||||
|
||||
if (FLAG_DEMO) {
|
||||
watch([refFullIFrame, refIFrame], () => {
|
||||
if (refIFrame.value) {
|
||||
refIFrame.value.reload = () => {
|
||||
useToast().show('warning', 'DEMO 模式该功能不可用')
|
||||
}
|
||||
}
|
||||
|
||||
document.querySelectorAll('iframe.lucky-sheet').forEach(x => {
|
||||
(x as any).contentWindow.fetch = window.fetch
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const button = (text: string, onClick: any) => h('button', {
|
||||
style: 'margin-left: 5px;font-size: 14px;background: #cacaca; border: 0; padding: 0 6px; color: #2c2b2b; cursor: pointer; border-radius: 2px; transition: all .1s ease-in-out; line-height: 24px;',
|
||||
onClick
|
||||
|
||||
@@ -143,7 +143,7 @@ if (FLAG_DEMO) {
|
||||
}
|
||||
|
||||
return xFetch(path).then(res => res.text()).then(md => {
|
||||
cache[path] = md
|
||||
cache[path] = md.replace(/```markdown\n(\[luckysheet\].+)\n```/, '$1')
|
||||
data.data.content = message + md
|
||||
return data
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user