Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
京东前端
nutui
提交
cfa11223
N
nutui
项目概览
京东前端
/
nutui
通知
37
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nutui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cfa11223
编写于
1月 25, 2019
作者:
F
Frans
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'v2' of
https://github.com/jdf2e/nutui
into v2
上级
551dda46
0a089514
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
1461 addition
and
3 deletion
+1461
-3
scripts/mdToVue.js
scripts/mdToVue.js
+1
-1
sites/doc/app.js
sites/doc/app.js
+3
-2
sites/doc/compents/backtop/backtop.css
sites/doc/compents/backtop/backtop.css
+29
-0
sites/doc/compents/backtop/backtop.css.map
sites/doc/compents/backtop/backtop.css.map
+1
-0
sites/doc/compents/backtop/backtop.js
sites/doc/compents/backtop/backtop.js
+1267
-0
sites/doc/compents/backtop/backtop.js.map
sites/doc/compents/backtop/backtop.js.map
+1
-0
sites/doc/compents/backtop/backtop.scss
sites/doc/compents/backtop/backtop.scss
+28
-0
sites/doc/compents/backtop/backtop.vue
sites/doc/compents/backtop/backtop.vue
+121
-0
sites/doc/compents/backtop/index.js
sites/doc/compents/backtop/index.js
+8
-0
sites/doc/root.js
sites/doc/root.js
+2
-0
未找到文件。
scripts/mdToVue.js
浏览文件 @
cfa11223
...
...
@@ -83,7 +83,7 @@ function createdFile(output, sorce, ishasCode) {
var
bufs
=
`<template><div @click="dsCode">
<div v-if="content" class="layer">
<pre><span class="close-box" @click="closelayer"></span><div v-html="content"></div></pre>
</div>`
+
res
+
`</div></template><script>import root from '../root.js';
</div>`
+
res
+
`<
nut-backtop></nut-backtop><
/div></template><script>import root from '../root.js';
export default {
mixins:[root]
}</script>`
;
...
...
sites/doc/app.js
浏览文件 @
cfa11223
...
...
@@ -4,8 +4,9 @@ import Vue from 'vue'
import
App
from
'
./App.vue
'
import
router
from
'
./router
'
;
import
copy
from
'
clipboard
'
;
import
backtop
from
'
./compents/backtop/backtop.js
'
;
import
'
./compents/backtop/backtop.css
'
;
backtop
.
install
(
Vue
);
import
'
highlight.js/styles/github.css
'
;
...
...
sites/doc/compents/backtop/backtop.css
0 → 100644
浏览文件 @
cfa11223
/*! NutUI2(2.0.2) - backtop.css, 4d177b46df0af221d246, 2019-01-25T10:47:27+08:00 */
.nut-backtop
{
display
:
none
;
line-height
:
0
;
position
:
fixed
;
cursor
:
pointer
;
bottom
:
20px
;
right
:
10px
;
z-index
:
1111
;
}
.nut-backtop.show
{
display
:
block
;
}
.nut-backtop-main
{
-webkit-transition
:
all
.2s
ease-in-out
;
transition
:
all
.2s
ease-in-out
;
width
:
38px
;
height
:
38px
;
background
:
#FFF
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 31 39'%3E%3Cg fill-rule='evenodd'%3E%3Cpath d='M1.41 0C.63 0 0 .672 0 1.5S.63 3 1.41 3h28.18C30.37 3 31 2.328 31 1.5S30.369 0 29.59 0H1.41zM17 7.5a1.5 1.5 0 0 0-3 0v30a1.5 1.5 0 1 0 3 0v-30zM8.44 12.44l-8 8a1.5 1.5 0 1 0 2.12 2.12l8-8a1.5 1.5 0 1 0-2.12-2.12z'/%3E%3Cpath d='M16.56 6.44l14 14a1.5 1.5 0 1 1-2.12 2.12l-14-14a1.5 1.5 0 1 1 2.12-2.12z'/%3E%3C/g%3E%3C/svg%3E")
no-repeat
center
;
background-size
:
20px
20px
;
border-radius
:
50%
;
border
:
2px
solid
rgba
(
180
,
180
,
180
,
0.5
);
box-shadow
:
0px
0px
2px
3px
rgba
(
220
,
220
,
220
,
0.1
);
}
.nut-backtop
i
{
color
:
#fff
;
font-size
:
24px
;
padding
:
8px
12px
;
line-height
:
0
;
}
/*# sourceMappingURL=backtop.css.map*/
\ No newline at end of file
sites/doc/compents/backtop/backtop.css.map
0 → 100644
浏览文件 @
cfa11223
{"version":3,"sources":["webpack://[name]/./src/packages/backtop/backtop.scss"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA;AACA,mBAAmB","file":"backtop/backtop.css","sourcesContent":[".nut-backtop {\n display: none;\n line-height: 0;\n position: fixed;\n cursor: pointer;\n bottom: 20px;\n right: 10px;\n z-index: 1111; }\n .nut-backtop.show {\n display: block; }\n .nut-backtop-main {\n -webkit-transition: all .2s ease-in-out;\n transition: all .2s ease-in-out;\n width: 38px;\n height: 38px;\n background: #FFF url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 31 39'%3E%3Cg fill-rule='evenodd'%3E%3Cpath d='M1.41 0C.63 0 0 .672 0 1.5S.63 3 1.41 3h28.18C30.37 3 31 2.328 31 1.5S30.369 0 29.59 0H1.41zM17 7.5a1.5 1.5 0 0 0-3 0v30a1.5 1.5 0 1 0 3 0v-30zM8.44 12.44l-8 8a1.5 1.5 0 1 0 2.12 2.12l8-8a1.5 1.5 0 1 0-2.12-2.12z'/%3E%3Cpath d='M16.56 6.44l14 14a1.5 1.5 0 1 1-2.12 2.12l-14-14a1.5 1.5 0 1 1 2.12-2.12z'/%3E%3C/g%3E%3C/svg%3E\") no-repeat center;\n background-size: 20px 20px;\n border-radius: 50%;\n border: 2px solid rgba(180, 180, 180, 0.5);\n box-shadow: 0px 0px 2px 3px rgba(220, 220, 220, 0.1); }\n .nut-backtop i {\n color: #fff;\n font-size: 24px;\n padding: 8px 12px;\n line-height: 0; }\n"],"sourceRoot":""}
\ No newline at end of file
sites/doc/compents/backtop/backtop.js
0 → 100644
浏览文件 @
cfa11223
此差异已折叠。
点击以展开。
sites/doc/compents/backtop/backtop.js.map
0 → 100644
浏览文件 @
cfa11223
此差异已折叠。
点击以展开。
sites/doc/compents/backtop/backtop.scss
0 → 100644
浏览文件 @
cfa11223
.nut-backtop
{
display
:
none
;
line-height
:
0
;
position
:
fixed
;
cursor
:
pointer
;
bottom
:
20px
;
right
:
10px
;
z-index
:
1111
;
&
.show
{
display
:
block
;
}
&
-main
{
transition
:
all
.2s
ease-in-out
;
width
:
38px
;
height
:
38px
;
background
:
#FFF
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 31 39'%3E%3Cg fill-rule='evenodd'%3E%3Cpath d='M1.41 0C.63 0 0 .672 0 1.5S.63 3 1.41 3h28.18C30.37 3 31 2.328 31 1.5S30.369 0 29.59 0H1.41zM17 7.5a1.5 1.5 0 0 0-3 0v30a1.5 1.5 0 1 0 3 0v-30zM8.44 12.44l-8 8a1.5 1.5 0 1 0 2.12 2.12l8-8a1.5 1.5 0 1 0-2.12-2.12z'/%3E%3Cpath d='M16.56 6.44l14 14a1.5 1.5 0 1 1-2.12 2.12l-14-14a1.5 1.5 0 1 1 2.12-2.12z'/%3E%3C/g%3E%3C/svg%3E")
no-repeat
center
;
background-size
:
20px
20px
;
border-radius
:
50%
;
border
:
2px
solid
rgba
(
180
,
180
,
180
,.
5
);
box-shadow
:
0px
0px
2px
3px
rgba
(
220
,
220
,
220
,
.1
)
}
i
{
color
:
#fff
;
font-size
:
24px
;
padding
:
8px
12px
;
line-height
:
0
;
}
}
\ No newline at end of file
sites/doc/compents/backtop/backtop.vue
0 → 100644
浏览文件 @
cfa11223
<
template
>
<div
:class=
"['nut-backtop',
{'show': backTop}]" :style="styles" @click="goto">
<slot>
<div
class=
"nut-backtop-main"
></div>
</slot>
</div>
</
template
>
<
script
>
export
default
{
name
:
"
nut-backtop
"
,
props
:
{
distance
:
{
type
:
Number
,
default
:
200
},
bottom
:
{
type
:
Number
,
default
:
20
},
right
:
{
type
:
Number
,
default
:
10
},
duration
:
{
type
:
Number
,
default
:
1000
},
zIndex
:
{
type
:
Number
,
default
:
1111
}
},
data
()
{
return
{
backTop
:
false
};
},
mounted
()
{
window
.
addEventListener
(
"
scroll
"
,
this
.
handleScroll
,
false
);
window
.
addEventListener
(
"
resize
"
,
this
.
handleScroll
,
false
);
},
beforeDestroy
()
{
window
.
removeEventListener
(
"
scroll
"
,
this
.
handleScroll
,
false
);
window
.
removeEventListener
(
"
resize
"
,
this
.
handleScroll
,
false
);
},
computed
:
{
styles
()
{
return
{
bottom
:
`
${
this
.
bottom
}
px`
,
right
:
`
${
this
.
right
}
px`
,
"
z-index
"
:
this
.
zIndex
};
}
},
methods
:
{
handleScroll
()
{
this
.
backTop
=
window
.
pageYOffset
>=
this
.
distance
;
},
goto
()
{
const
sTop
=
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
;
this
.
scrollTop
(
window
,
sTop
,
0
,
this
.
duration
);
this
.
$emit
(
"
click
"
);
},
scrollTop
(
el
,
from
=
0
,
to
,
duration
=
500
,
endCallback
)
{
this
.
el
=
el
;
let
lastTime
=
0
;
let
vendors
=
[
"
webkit
"
,
"
moz
"
];
for
(
let
x
=
0
;
x
<
vendors
.
length
&&
!
window
.
requestAnimationFrame
;
++
x
)
{
window
.
requestAnimationFrame
=
window
[
vendors
[
x
]
+
"
RequestAnimationFrame
"
];
window
.
cancelAnimationFrame
=
window
[
vendors
[
x
]
+
"
CancelAnimationFrame
"
]
||
window
[
vendors
[
x
]
+
"
CancelRequestAnimationFrame
"
];
}
if
(
!
window
.
requestAnimationFrame
)
{
window
.
requestAnimationFrame
=
function
(
callback
,
element
)
{
let
currTime
=
new
Date
().
getTime
();
let
timeToCall
=
Math
.
max
(
0
,
16.7
-
(
currTime
-
lastTime
));
let
id
=
window
.
setTimeout
(
function
()
{
callback
(
currTime
+
timeToCall
);
},
timeToCall
);
lastTime
=
currTime
+
timeToCall
;
return
id
;
};
}
if
(
!
window
.
cancelAnimationFrame
)
{
window
.
cancelAnimationFrame
=
function
(
id
)
{
clearTimeout
(
id
);
};
}
const
difference
=
Math
.
abs
(
from
-
to
);
const
step
=
Math
.
ceil
((
difference
/
duration
)
*
50
);
this
.
scroll
(
from
,
to
,
step
,
endCallback
);
},
scroll
(
start
,
end
,
step
,
endCallback
)
{
if
(
start
===
end
)
{
endCallback
&&
endCallback
();
return
;
}
let
d
=
start
+
step
>
end
?
end
:
start
+
step
;
if
(
start
>
end
)
{
d
=
start
-
step
<
end
?
end
:
start
-
step
;
}
if
(
this
.
el
===
window
)
{
window
.
scrollTo
(
d
,
d
);
}
else
{
this
.
el
.
scrollTop
=
d
;
}
window
.
requestAnimationFrame
(()
=>
this
.
scroll
(
d
,
end
,
step
));
}
}
};
</
script
>
\ No newline at end of file
sites/doc/compents/backtop/index.js
0 → 100644
浏览文件 @
cfa11223
import
BackTop
from
'
./backtop.vue
'
;
import
'
./backtop.scss
'
;
BackTop
.
install
=
function
(
Vue
)
{
Vue
.
component
(
BackTop
.
name
,
BackTop
);
};
export
default
BackTop
\ No newline at end of file
sites/doc/root.js
浏览文件 @
cfa11223
var
myMixin
=
{
data
(){
return
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录