refactor: login page (#259)

This commit is contained in:
啝裳
2022-04-30 20:52:06 +08:00
committed by GitHub
parent 3d304457f5
commit bedbf8077b
26 changed files with 1863 additions and 1164 deletions

View File

@@ -0,0 +1,40 @@
import { h, defineComponent, withDirectives, resolveDirective } from "vue";
// 封装@vueuse/motion动画库中的自定义指令v-motion
export default defineComponent({
name: "Motion",
props: {
delay: {
type: Number,
default: 50
}
},
render() {
const { delay } = this;
const motion = resolveDirective("motion");
return withDirectives(
h(
"div",
{},
{
default: () => [this.$slots.default()]
}
),
[
[
motion,
{
initial: { opacity: 0, y: 100 },
enter: {
opacity: 1,
y: 0,
transition: {
delay
}
}
}
]
]
);
}
});