-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from zzxming/dev
- Loading branch information
Showing
23 changed files
with
458 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,50 @@ | ||
<script lang="ts" setup> | ||
import { ref, computed } from 'vue'; | ||
const props = defineProps<{ | ||
source: string; | ||
}>(); | ||
const isExpand = ref(false); | ||
const exampleCodeText = computed(() => (isExpand.value ? '隐藏源代码' : '查看源代码')); | ||
const exampleCodeStyle = computed(() => ({ | ||
height: isExpand.value ? 'auto' : '0', | ||
})); | ||
const code = computed(() => decodeURIComponent(props.source)); | ||
</script> | ||
|
||
<template> | ||
<div class="example-source"> | ||
<div | ||
class="example-source-wrapper" | ||
:style="exampleCodeStyle" | ||
> | ||
<div | ||
class="example-source-code language-vue" | ||
v-html="code" | ||
/> | ||
</div> | ||
<div | ||
class="example-source-expand" | ||
@click="isExpand = !isExpand" | ||
> | ||
{{ exampleCodeText }} | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style lang="less" scoped> | ||
.example { | ||
&-source { | ||
&-wrapper { | ||
@apply overflow-hidden; | ||
} | ||
&-expand { | ||
@apply sticky bottom-0 z-10 w-full flex items-center justify-center p-2 | ||
border-t cursor-pointer text-gray-500 hover:text-blue-500 bg-white rounded-b-lg; | ||
} | ||
} | ||
} | ||
</style> | ||
<script lang="ts" setup> | ||
import { CdxCollapseTransition } from 'cdx-component'; | ||
import { ref, computed } from 'vue'; | ||
const props = defineProps<{ | ||
source: string; | ||
}>(); | ||
const isExpand = ref(false); | ||
const exampleCodeText = computed(() => (isExpand.value ? '隐藏源代码' : '查看源代码')); | ||
const code = computed(() => decodeURIComponent(props.source)); | ||
</script> | ||
|
||
<template> | ||
<div class="example-source"> | ||
<CdxCollapseTransition> | ||
<div | ||
class="example-source-wrapper" | ||
v-show="isExpand" | ||
> | ||
<div | ||
class="example-source-code language-vue" | ||
v-html="code" | ||
/> | ||
</div> | ||
</CdxCollapseTransition> | ||
<div | ||
class="example-source-expand" | ||
@click="isExpand = !isExpand" | ||
> | ||
{{ exampleCodeText }} | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style lang="less"> | ||
.example { | ||
&-source { | ||
&-wrapper { | ||
@apply overflow-hidden; | ||
} | ||
&-expand { | ||
background-color: var(--vp-c-bg); | ||
@apply sticky bottom-0 z-10 w-full flex items-center justify-center p-2 | ||
border-t cursor-pointer text-gray-500 hover:text-blue-500 rounded-b-lg; | ||
} | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ | |
|
||
## 点击验证 | ||
|
||
可使用 `onBeforeSuccess` 监听验证验证并控制是否验证成功 | ||
|
||
:::demo captcha/point | ||
|
||
::: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
module.exports = { | ||
content: ['./**/*.{less,vue}'], | ||
theme: { | ||
extend: {}, | ||
}, | ||
plugins: [], | ||
}; | ||
/** @type {import('tailwindcss').Config} */ | ||
module.exports = { | ||
content: ['./**/*.{less,vue}'], | ||
darkMode: 'selector', | ||
theme: { | ||
extend: {}, | ||
}, | ||
plugins: [], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
@import '../shared/variables.less'; | ||
@import '../shared/functions.less'; | ||
@import './createKeyframe.less'; | ||
|
||
.keyframes(e('@{namespace}-fade-out'), { | ||
0% { | ||
opacity: 1; | ||
} | ||
100% { | ||
opacity: 0; | ||
} | ||
}); | ||
.keyframes(e('@{namespace}-fade-in'), { | ||
0% { | ||
opacity: 0; | ||
} | ||
100% { | ||
opacity: 1; | ||
} | ||
}); | ||
.fade-in() { | ||
animation: e('@{namespace}-fade-in') .getCssVar(transition-duration) [] ease-in-out; | ||
} | ||
.fade-out() { | ||
animation: e('@{namespace}-fade-out') .getCssVar(transition-duration) [] ease-in-out; | ||
} | ||
|
||
.@{namespace}-fade { | ||
&-enter-active { | ||
.fade-in(); | ||
} | ||
&-leave-active { | ||
.fade-out(); | ||
} | ||
} | ||
@import '../shared/variables.less'; | ||
@import '../shared/functions.less'; | ||
@import './createKeyframe.less'; | ||
|
||
.keyframes(e('@{namespace}-fade-out'), { | ||
0% { | ||
opacity: 1; | ||
} | ||
100% { | ||
opacity: 0; | ||
} | ||
}); | ||
.keyframes(e('@{namespace}-fade-in'), { | ||
0% { | ||
opacity: 0; | ||
} | ||
100% { | ||
opacity: 1; | ||
} | ||
}); | ||
.fade-in() { | ||
animation: e('@{namespace}-fade-in') .getCssVar(transition-duration) [] ease-in-out; | ||
} | ||
.fade-out() { | ||
animation: e('@{namespace}-fade-out') .getCssVar(transition-duration) [] ease-in-out; | ||
} | ||
|
||
.@{namespace}-fade { | ||
&-enter-active { | ||
.fade-in(); | ||
} | ||
&-leave-active { | ||
.fade-out(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.