Commit 340f31330a4ab71b8fdbb1a0e284d76aca004d03
1 parent
67d57f79
update header: add document link
Showing
4 changed files
with
55 additions
and
9 deletions
front-end/h5/src/components/common/header/links.js
0 → 100644
| 1 | +/** | |
| 2 | + * #!zh: 导航条上的通用外链:文档、交流群、GitHub | |
| 3 | + * #!en: common external links on headers: Document、Discussion、GitHub | |
| 4 | + */ | |
| 5 | + | |
| 6 | +export default { | |
| 7 | + render () { | |
| 8 | + return ( | |
| 9 | + <a-menu | |
| 10 | + theme="dark" | |
| 11 | + mode="horizontal" | |
| 12 | + defaultSelectedKeys={['2']} | |
| 13 | + style={{ lineHeight: '64px', display: 'inline-block', float: 'right' }} | |
| 14 | + > | |
| 15 | + <a-menu-item key="document"> | |
| 16 | + <a href="http://docs.luban-h5.surge.sh/" target="_blank" rel="noopener" style={{ color: 'white' }}><a-icon type="read" />文档</a> | |
| 17 | + </a-menu-item> | |
| 18 | + <a-menu-item key="dingtalk" > | |
| 19 | + <a-popover title="👨🏻💻👩🏻💻欢迎加入鲁班-H5交流群"> | |
| 20 | + <template slot="content"> | |
| 21 | + <p>For users in other languages, <br />please keep using Github issue tracker. 🤟 </p> | |
| 22 | + <p>扫描二维码加入 钉钉 讨论组</p> | |
| 23 | + <img src="https://user-images.githubusercontent.com/12668546/61447488-a379f700-a983-11e9-9956-139352a2585d.png" width="200" /> | |
| 24 | + <p>因为微信群二维码会过期,<br />请前往<a href="https://github.com/ly525/luban-h5/issues/57" target="_blank" rel="noopener">微信群和QQ群</a> 查看</p> | |
| 25 | + </template> | |
| 26 | + <span style={{ color: 'white', lineHeight: '64px', height: '64px', display: 'inline-block' }}><a-icon type="qrcode" />交流群</span> | |
| 27 | + </a-popover> | |
| 28 | + </a-menu-item> | |
| 29 | + <a-menu-item key="github"> | |
| 30 | + <a href="https://github.com/ly525/luban-h5" target="_blank" rel="noopener" style={{ color: 'white' }}><a-icon type="github" />Github</a> | |
| 31 | + </a-menu-item> | |
| 32 | + </a-menu> | |
| 33 | + ) | |
| 34 | + } | |
| 35 | +} | ... | ... |
front-end/h5/src/components/common/header/logo.js
0 → 100644
front-end/h5/src/components/core/editor/index.js
| ... | ... | @@ -12,6 +12,9 @@ import RenderActoionEditor from './edit-panel/action' |
| 12 | 12 | import RenderShortcutsPanel from './shortcuts-panel/index' |
| 13 | 13 | import PreviewDialog from './modals/preview.vue' |
| 14 | 14 | |
| 15 | +import LogoOfHeader from '@/components/common/header/logo.js' | |
| 16 | +import ExternalLinksOfHeader from '@/components/common/header/links.js' | |
| 17 | + | |
| 15 | 18 | const sidebarMenus = [ |
| 16 | 19 | { |
| 17 | 20 | label: '组件列表', |
| ... | ... | @@ -78,7 +81,10 @@ const fixedTools = [ |
| 78 | 81 | |
| 79 | 82 | export default { |
| 80 | 83 | name: 'Editor', |
| 81 | - components: {}, | |
| 84 | + components: { | |
| 85 | + LogoOfHeader, | |
| 86 | + ExternalLinksOfHeader | |
| 87 | + }, | |
| 82 | 88 | data: () => ({ |
| 83 | 89 | activeMenuKey: 'pluginList', |
| 84 | 90 | isPreviewMode: false, |
| ... | ... | @@ -149,7 +155,7 @@ export default { |
| 149 | 155 | return ( |
| 150 | 156 | <a-layout id="luban-editor-layout" style={{ height: '100vh' }}> |
| 151 | 157 | <a-layout-header class="header"> |
| 152 | - <div class="logo">鲁班 H5</div> | |
| 158 | + <LogoOfHeader /> | |
| 153 | 159 | {/* TODO we can show the plugins shortcuts here */} |
| 154 | 160 | <a-menu |
| 155 | 161 | theme="dark" |
| ... | ... | @@ -157,16 +163,11 @@ export default { |
| 157 | 163 | defaultSelectedKeys={['2']} |
| 158 | 164 | style={{ lineHeight: '64px', float: 'right', background: 'transparent' }} |
| 159 | 165 | > |
| 160 | - <a-menu-item key="4" class="transparent-bg"> | |
| 161 | - <a-button-group> | |
| 162 | - <a-button class="transparent-bg" style={{ color: 'white' }} type="dashed" size="small" onClick={() => undoRedoHistory.undo()}><i class={['shortcut-icon', 'fa', `fa-mail-reply`]} aria-hidden='true'/> 撤销</a-button> | |
| 163 | - <a-button class="transparent-bg" style={{ color: 'white' }} type="dashed" size="small" onClick={() => undoRedoHistory.redo()}><i class={['shortcut-icon', 'fa', `fa-mail-forward`]} aria-hidden='true'/> 重做</a-button> | |
| 164 | - </a-button-group> | |
| 165 | - </a-menu-item> | |
| 166 | 166 | <a-menu-item key="1" class="transparent-bg"><a-button type="primary" size="small" onClick={() => { this.previewVisible = true }}>预览</a-button></a-menu-item> |
| 167 | 167 | <a-menu-item key="2" class="transparent-bg"><a-button size="small" onClick={() => this.saveWork()} loading={this.saveWork_loading}>保存</a-button></a-menu-item> |
| 168 | 168 | <a-menu-item key="3" class="transparent-bg"><a-button size="small">发布</a-button></a-menu-item> |
| 169 | 169 | </a-menu> |
| 170 | + <ExternalLinksOfHeader /> | |
| 170 | 171 | </a-layout-header> |
| 171 | 172 | <a-layout> |
| 172 | 173 | <a-layout-sider width="160" style="background: #fff" collapsed> | ... | ... |
front-end/h5/src/views/work-manager/index.vue
| ... | ... | @@ -2,6 +2,8 @@ |
| 2 | 2 | // import PreView from '@/pages/preview'; |
| 3 | 3 | // import Sidebar from './components/sidebar.vue' |
| 4 | 4 | import '@/components/core/styles/index.scss' |
| 5 | +import LogoOfHeader from '@/components/common/header/logo.js' | |
| 6 | +import ExternalLinksOfHeader from '@/components/common/header/links.js' | |
| 5 | 7 | |
| 6 | 8 | const sidebarMenus = [ |
| 7 | 9 | { |
| ... | ... | @@ -52,6 +54,8 @@ export default { |
| 52 | 54 | components: { |
| 53 | 55 | // PreView, |
| 54 | 56 | // Sidebar |
| 57 | + LogoOfHeader, | |
| 58 | + ExternalLinksOfHeader | |
| 55 | 59 | }, |
| 56 | 60 | methods: { |
| 57 | 61 | renderSidebar (menus) { |
| ... | ... | @@ -83,7 +87,7 @@ export default { |
| 83 | 87 | return ( |
| 84 | 88 | <a-layout id="luban-work-manager-layout" style={{ height: '100vh' }}> |
| 85 | 89 | <a-layout-header class="header"> |
| 86 | - <div class="logo">鲁班 H5</div> | |
| 90 | + <LogoOfHeader /> | |
| 87 | 91 | {/* TODO we can show the plugins shortcuts here */} |
| 88 | 92 | <a-dropdown style={{ float: 'right', background: 'transparent', margin: '16px 28px 16px 0' }}> |
| 89 | 93 | <a-menu slot="overlay" onClick={() => {}}> |
| ... | ... | @@ -96,6 +100,7 @@ export default { |
| 96 | 100 | </a-menu> |
| 97 | 101 | <a-avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" /> |
| 98 | 102 | </a-dropdown> |
| 103 | + <ExternalLinksOfHeader /> | |
| 99 | 104 | </a-layout-header> |
| 100 | 105 | <a-layout> |
| 101 | 106 | <a-layout-sider width="160" style="background: #fff"> | ... | ... |