Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ant-design-pro-vue
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianzhuanghu
ant-design-pro-vue
Commits
0b93e26e
Commit
0b93e26e
authored
Dec 20, 2018
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add FooterToolBar
parent
b44f9af6
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
130 additions
and
33 deletions
+130
-33
FooterToolBar.vue
src/components/FooterToolbar/FooterToolBar.vue
+31
-0
index.js
src/components/FooterToolbar/index.js
+5
-0
index.less
src/components/FooterToolbar/index.less
+21
-30
index.md
src/components/FooterToolbar/index.md
+48
-0
mixin.js
src/utils/mixin.js
+8
-0
AdvancedForm.vue
src/views/form/advancedForm/AdvancedForm.vue
+4
-2
vue.config.js
vue.config.js
+5
-1
yarn.lock
yarn.lock
+8
-0
No files found.
src/components/FooterToolbar/FooterToolBar.vue
0 → 100644
View file @
0b93e26e
<
template
>
<div
:class=
"prefixCls"
>
<div
style=
"float: left"
>
<slot
name=
"extra"
>
{{
extra
}}
</slot>
</div>
<div
style=
"float: right"
>
<slot></slot>
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
'FooterToolBar'
,
props
:
{
prefixCls
:
{
type
:
String
,
default
:
'ant-pro-footer-toolbar'
},
extra
:
{
type
:
[
String
,
Object
],
default
:
''
}
}
}
</
script
>
<
style
lang=
"less"
scoped
>
</
style
>
\ No newline at end of file
src/components/FooterToolbar/index.js
0 → 100644
View file @
0b93e26e
import
FooterToolBar
from
'./FooterToolBar'
import
'./index.less'
export
default
FooterToolBar
\ No newline at end of file
src/components/
tools/FooterToolBar.vue
→
src/components/
FooterToolbar/index.less
View file @
0b93e26e
<
template
>
@import "../index";
<div
class=
"toolbar"
>
<div
style=
"float: left"
>
<slot
name=
"extra"
></slot>
</div>
<div
style=
"float: right"
>
<slot></slot>
</div>
</div>
</
template
>
<
script
>
@footer-toolbar-prefix-cls: ~"@{ant-pro-prefix}-footer-toolbar";
export
default
{
name
:
'FooterToolBar'
.@{footer-toolbar-prefix-cls} {
}
position: fixed;
</
script
>
width: 100%;
bottom: 0;
right: 0;
height: 56px;
line-height: 56px;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.03);
background: #fff;
border-top: 1px solid #e8e8e8;
padding: 0 24px;
z-index: 9;
<
style
lang=
"scss"
scoped
>
&:after {
.toolbar
{
content: "";
position
:
fixed
;
display: block;
width
:
100%
;
clear: both;
bottom
:
0
;
right
:
0
;
height
:
56px
;
line-height
:
56px
;
box-shadow
:
0
-1px
2px
rgba
(
0
,
0
,
0
,
0.03
);
background
:
#fff
;
border-top
:
1px
solid
#e8e8e8
;
padding
:
0
24px
;
z-index
:
9
;
}
}
</
style
>
}
\ No newline at end of file
\ No newline at end of file
src/components/FooterToolbar/index.md
0 → 100644
View file @
0b93e26e
# FooterToolbar底部工具栏
固定在底部的工具栏。
## 何时使用
固定在内容区域的底部,不随滚动条移动,常用于长页面的数据搜集和提交工作。
引用方式:
```
javascript
import
FooterToolBar
from
'@/components/FooterToolbar'
export
default
{
components
:
{
FooterToolBar
}
}
```
## 代码演示
```
html
<footer-tool-bar>
<a-button
type=
"primary"
@
click=
"validate"
:loading=
"loading"
>
提交
</a-button>
</footer-tool-bar>
```
或
```
html
<footer-tool-bar
extra=
"扩展信息提示"
>
<a-button
type=
"primary"
@
click=
"validate"
:loading=
"loading"
>
提交
</a-button>
</footer-tool-bar>
```
## API
参数 | 说明 | 类型 | 默认值
----|------|-----|------
children (slot) | 工具栏内容,向右对齐 | - | -
extra | 额外信息,向左对齐 | String, Object | -
src/utils/mixin.js
View file @
0b93e26e
...
@@ -17,6 +17,14 @@ const mixin = {
...
@@ -17,6 +17,14 @@ const mixin = {
autoHideHeader
:
state
=>
state
.
app
.
autoHideHeader
,
autoHideHeader
:
state
=>
state
.
app
.
autoHideHeader
,
sidebarOpened
:
state
=>
state
.
app
.
sidebar
.
opened
sidebarOpened
:
state
=>
state
.
app
.
sidebar
.
opened
})
})
},
methods
:
{
isTopmenu
()
{
return
this
.
layoutMode
===
'topmenu'
},
isSideMenu
()
{
return
!
this
.
isTopmenu
()
}
}
}
}
}
...
...
src/views/form/advancedForm/AdvancedForm.vue
View file @
0b93e26e
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
</a-card>
</a-card>
<!-- fixed footer toolbar -->
<!-- fixed footer toolbar -->
<footer-tool-bar>
<footer-tool-bar
:style=
"{ width: isSideMenu() && isDesktop() ? `calc(100% - ${sidebarOpened ? 256 : 80}px)` : '100%'}"
>
<a-button
type=
"primary"
@
click=
"validate"
:loading=
"loading"
>
提交
</a-button>
<a-button
type=
"primary"
@
click=
"validate"
:loading=
"loading"
>
提交
</a-button>
</footer-tool-bar>
</footer-tool-bar>
</div>
</div>
...
@@ -64,10 +64,12 @@
...
@@ -64,10 +64,12 @@
<
script
>
<
script
>
import
RepositoryForm
from
'./RepositoryForm'
import
RepositoryForm
from
'./RepositoryForm'
import
TaskForm
from
'./TaskForm'
import
TaskForm
from
'./TaskForm'
import
FooterToolBar
from
'@/components/tools/FooterToolBar'
import
FooterToolBar
from
'@/components/FooterToolbar'
import
{
mixin
,
mixinDevice
}
from
'@/utils/mixin'
export
default
{
export
default
{
name
:
'AdvancedForm'
,
name
:
'AdvancedForm'
,
mixins
:
[
mixin
,
mixinDevice
],
components
:
{
components
:
{
FooterToolBar
,
FooterToolBar
,
RepositoryForm
,
RepositoryForm
,
...
...
vue.config.js
View file @
0b93e26e
const
path
=
require
(
'path'
)
const
path
=
require
(
'path'
)
const
webpack
=
require
(
'webpack'
)
function
resolve
(
dir
)
{
function
resolve
(
dir
)
{
return
path
.
join
(
__dirname
,
dir
)
return
path
.
join
(
__dirname
,
dir
)
...
@@ -21,7 +22,10 @@ module.exports = {
...
@@ -21,7 +22,10 @@ module.exports = {
},
},
*/
*/
configureWebpack
:
{
configureWebpack
:
{
plugins
:
[
// Ignore all locale files of moment.js
new
webpack
.
IgnorePlugin
(
/^
\.\/
locale$/
,
/moment$/
),
]
},
},
chainWebpack
:
(
config
)
=>
{
chainWebpack
:
(
config
)
=>
{
...
...
yarn.lock
View file @
0b93e26e
...
@@ -1695,6 +1695,14 @@ babel-plugin-dynamic-import-node@^2.2.0:
...
@@ -1695,6 +1695,14 @@ babel-plugin-dynamic-import-node@^2.2.0:
dependencies:
dependencies:
object.assign "^4.1.0"
object.assign "^4.1.0"
babel-plugin-import@^1.11.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/babel-plugin-import/-/babel-plugin-import-1.11.0.tgz#78ac908e6b225206babb734e19eae5f78d6d1035"
integrity sha512-de9dWdU1YjmWRPYurlHRKD2hTd24z0bIQ0/JgyXqLMXML+TsvEkVhtqzOsNtu9MmCuvwBiTTTjZBbZXA1Xu7TQ==
dependencies:
"@babel/helper-module-imports" "^7.0.0"
"@babel/runtime" "^7.0.0"
babel-plugin-transform-runtime@^6.23.0:
babel-plugin-transform-runtime@^6.23.0:
version "6.23.0"
version "6.23.0"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-runtime/download/babel-plugin-transform-runtime-6.23.0.tgz#88490d446502ea9b8e7efb0fe09ec4d99479b1ee"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-runtime/download/babel-plugin-transform-runtime-6.23.0.tgz#88490d446502ea9b8e7efb0fe09ec4d99479b1ee"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment