Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
najiu-frontend
najiu-admin-template
Commits
afc7263e
Commit
afc7263e
authored
Oct 12, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add count-to component and demo
parent
4811cce8
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
79 additions
and
23 deletions
+79
-23
package.json
package.json
+1
-1
FullLoading.vue
src/components/Loading/FullLoading.vue
+2
-2
index.ts
src/components/Transition/index.ts
+19
-16
pageLoadingGuard.ts
src/router/guard/pageLoadingGuard.ts
+0
-3
comp.ts
src/router/menus/modules/demo/comp.ts
+4
-0
comp.ts
src/router/routes/modules/demo/comp.ts
+8
-0
index.vue
src/views/demo/comp/count-to/index.vue
+42
-0
Rotate.vue
src/views/demo/comp/verify/Rotate.vue
+3
-1
No files found.
package.json
View file @
afc7263e
{
"name"
:
"vben-admin-2.0"
,
"version"
:
"2.0.0-beta.
5
"
,
"version"
:
"2.0.0-beta.
6
"
,
"scripts"
:
{
"bootstrap"
:
"yarn install"
,
"serve"
:
"ts-node --project ./build/tsconfig.json ./build/script/preserve && cross-env NODE_ENV=development vite"
,
...
...
src/components/Loading/FullLoading.vue
View file @
afc7263e
...
...
@@ -41,8 +41,8 @@
display: flex;
width: 100%;
height: 100%;
// background: rgba(255, 255, 255, 0.
5
);
background:
#f1f1f63d
;
// background: rgba(255, 255, 255, 0.
3
);
background:
rgba(241, 241, 246, 0.8)
;
justify-content: center;
align-items: center;
}
...
...
src/components/Transition/index.ts
View file @
afc7263e
import
{
createSimpleTransition
,
createJavascriptTransition
}
from
'
./src/CreateTransition
'
;
import
{
// createSimpleTransition,
createJavascriptTransition
,
}
from
'
./src/CreateTransition
'
;
import
ExpandTransitionGenerator
from
'
./src/ExpandTransition
'
;
export
{
default
as
CollapseTransition
}
from
'
./src/CollapseTransition
'
;
export
const
FadeTransition
=
createSimpleTransition
(
'
fade-transition
'
);
export
const
ScaleTransition
=
createSimpleTransition
(
'
scale-transition
'
);
export
const
SlideYTransition
=
createSimpleTransition
(
'
slide-y-transition
'
);
export
const
ScrollYTransition
=
createSimpleTransition
(
'
scroll-y-transition
'
);
export
const
SlideYReverseTransition
=
createSimpleTransition
(
'
slide-y-reverse-transition
'
);
export
const
ScrollYReverseTransition
=
createSimpleTransition
(
'
scroll-y-reverse-transition
'
);
export
const
SlideXTransition
=
createSimpleTransition
(
'
slide-x-transition
'
);
export
const
ScrollXTransition
=
createSimpleTransition
(
'
scroll-x-transition
'
);
export
const
SlideXReverseTransition
=
createSimpleTransition
(
'
slide-x-reverse-transition
'
);
export
const
ScrollXReverseTransition
=
createSimpleTransition
(
'
scroll-x-reverse-transition
'
);
export
const
ScaleRotateTransition
=
createSimpleTransition
(
'
scale-rotate-transition
'
);
//
export const FadeTransition = createSimpleTransition('fade-transition');
//
export const ScaleTransition = createSimpleTransition('scale-transition');
//
export const SlideYTransition = createSimpleTransition('slide-y-transition');
//
export const ScrollYTransition = createSimpleTransition('scroll-y-transition');
//
export const SlideYReverseTransition = createSimpleTransition('slide-y-reverse-transition');
//
export const ScrollYReverseTransition = createSimpleTransition('scroll-y-reverse-transition');
//
export const SlideXTransition = createSimpleTransition('slide-x-transition');
//
export const ScrollXTransition = createSimpleTransition('scroll-x-transition');
//
export const SlideXReverseTransition = createSimpleTransition('slide-x-reverse-transition');
//
export const ScrollXReverseTransition = createSimpleTransition('scroll-x-reverse-transition');
//
export const ScaleRotateTransition = createSimpleTransition('scale-rotate-transition');
// Javascript transitions
export
const
ExpandTransition
=
createJavascriptTransition
(
...
...
@@ -22,7 +25,7 @@ export const ExpandTransition = createJavascriptTransition(
ExpandTransitionGenerator
()
);
export
const
ExpandXTransition
=
createJavascriptTransition
(
'
expand-x-transition
'
,
ExpandTransitionGenerator
(
''
,
true
)
);
//
export const ExpandXTransition = createJavascriptTransition(
//
'expand-x-transition',
//
ExpandTransitionGenerator('', true)
//
);
src/router/guard/pageLoadingGuard.ts
View file @
afc7263e
...
...
@@ -6,9 +6,6 @@ import { userStore } from '/@/store/modules/user';
export
function
createPageLoadingGuard
(
router
:
Router
)
{
let
isFirstLoad
=
true
;
router
.
beforeEach
(
async
(
to
)
=>
{
console
.
log
(
'
======================
'
);
console
.
log
(
2
);
console
.
log
(
'
======================
'
);
const
{
openKeepAlive
,
openRouterTransition
,
...
...
src/router/menus/modules/demo/comp.ts
View file @
afc7263e
...
...
@@ -9,6 +9,10 @@ const menu: MenuModule = {
path
:
'
/basic
'
,
name
:
'
基础组件
'
,
},
{
path
:
'
/countTo
'
,
name
:
'
数字动画
'
,
},
{
path
:
'
/scroll
'
,
...
...
src/router/routes/modules/demo/comp.ts
View file @
afc7263e
...
...
@@ -23,6 +23,14 @@ export default {
title
:
'
基础组件
'
,
},
},
{
path
:
'
/countTo
'
,
name
:
'
CountTo
'
,
component
:
()
=>
import
(
'
/@/views/demo/comp/count-to/index.vue
'
),
meta
:
{
title
:
'
数字动画
'
,
},
},
{
path
:
'
/scroll
'
,
...
...
src/views/demo/comp/count-to/index.vue
0 → 100644
View file @
afc7263e
<
template
>
<div
class=
"p-4 count-to-demo"
>
<Card>
<CardGrid
class=
"count-to-demo-card"
>
<CountTo
prefix=
"$"
:startVal=
"1"
:endVal=
"200000"
:duration=
"8000"
/>
</CardGrid>
<CardGrid
class=
"count-to-demo-card"
>
<CountTo
suffix=
"$"
:startVal=
"1"
:endVal=
"300000"
:decimals=
"2"
:duration=
"6000"
/>
</CardGrid>
<CardGrid
class=
"count-to-demo-card"
>
<CountTo
suffix=
"$"
:startVal=
"1"
:endVal=
"400000"
:duration=
"7000"
/>
</CardGrid>
<CardGrid
class=
"count-to-demo-card"
>
<CountTo
separator=
"-"
:startVal=
"10000"
:endVal=
"500000"
:duration=
"8000"
/>
</CardGrid>
</Card>
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'
vue
'
;
import
{
Card
}
from
'
ant-design-vue
'
;
import
{
CountTo
}
from
'
/@/components/CountTo/index
'
;
export
default
defineComponent
({
components
:
{
Card
,
CardGrid
:
Card
.
Grid
,
CountTo
,
},
setup
()
{
return
{};
},
});
</
script
>
<
style
lang=
"less"
scoped
>
.count-to-demo {
&-card {
width: 50%;
font-size: 30px;
text-align: center;
}
}
</
style
>
src/views/demo/comp/verify/Rotate.vue
View file @
afc7263e
<
template
>
<div
class=
"p-10"
>
<div
class=
"flex justify-center p-4 items-center bg-gray-700"
>
<RotateDragVerify
src=
"/@/assets/images/header.jp
g"
ref=
"el"
@
success=
"handleSuccess"
/>
<RotateDragVerify
:src=
"im
g"
ref=
"el"
@
success=
"handleSuccess"
/>
</div>
</div>
</
template
>
...
...
@@ -9,6 +9,7 @@
import
{
defineComponent
}
from
'
vue
'
;
import
{
RotateDragVerify
}
from
'
/@/components/Verify/index
'
;
import
img
from
'
/@/assets/images/header.jpg
'
;
export
default
defineComponent
({
components
:
{
RotateDragVerify
},
setup
()
{
...
...
@@ -17,6 +18,7 @@
};
return
{
handleSuccess
,
img
,
};
},
});
...
...
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