Skip to content

Commit 27b98a5

Browse files
committed
Fix info
1 parent 94a776e commit 27b98a5

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

src/components/Dialog/Dialog.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
:fields="request.body"
2424
v-model="responseData"/>
2525

26+
<component
27+
v-for="(component, index) in request.body"
28+
v-else-if="request.type === 'component'"
29+
:key="`dialog-component-${index}`"
30+
:is="component"/>
31+
2632
<div class="mp-dialog-footer">
2733
<div>
2834
<button
@@ -140,6 +146,8 @@ export default {
140146
initialData[field.name] = field.default ? field.default : ''
141147
} else if (this.request.type === 'tab') {
142148
initialData[field.name] = {}
149+
} else if(this.request.type === 'component') {
150+
initialData[field.name] = null
143151
}
144152
})
145153
return {

src/components/ToolBarBtns/btn-info.jsx

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,19 @@ export default {
55
action () {
66
this.openDialog({
77
title: '关于',
8+
type: 'component',
89
body: [{
9-
component: {
10-
functional: true,
11-
render: (h, { injections: {t} }) =>
12-
<div style="text-align: center">
13-
<p>
14-
<strong>{ t('Markdown*Palettes') }</strong> { t('是一个开源的 Markdown 编辑器,面向现代化网络环境。') }
15-
</p>
16-
<p>
17-
<a href="https://github.com/luogu-dev/markdown-palettes" target="_blank">{ t('访问 GitHub 项目地址') }</a>
18-
</p>
19-
</div>,
20-
inject: ['t']
21-
}
10+
functional: true,
11+
render: (h, { injections: {t} }) =>
12+
<div style="text-align: center">
13+
<p>
14+
<strong>{ t('Markdown*Palettes') }</strong> { t('是一个开源的 Markdown 编辑器,面向现代化网络环境。') }
15+
</p>
16+
<p>
17+
<a href="https://github.com/luogu-dev/markdown-palettes" target="_blank">{ t('访问 GitHub 项目地址') }</a>
18+
</p>
19+
</div>,
20+
inject: ['t']
2221
}]
2322
})
2423
}

0 commit comments

Comments
 (0)