feat: add the configuration of disable animation; 🌟
新增:禁用页面切换动画的功能;
This commit is contained in:
@@ -67,6 +67,10 @@
|
||||
<a-divider />
|
||||
<setting-item :title="$t('animate.title')">
|
||||
<a-list :split="false">
|
||||
<a-list-item>
|
||||
{{$t('animate.disable')}}
|
||||
<a-switch :checked="animate.disabled" slot="actions" size="small" @change="val => setAnimate({...animate, disabled: val})" />
|
||||
</a-list-item>
|
||||
<a-list-item>
|
||||
{{$t('animate.effect')}}
|
||||
<a-select
|
||||
@@ -139,17 +143,17 @@ export default {
|
||||
const dftValue = setting[key], myValue = mySetting[key]
|
||||
// 只提取与默认配置不同的配置项
|
||||
if (dftValue != undefined && !fastEqual(dftValue, myValue)) {
|
||||
console.log(myValue)
|
||||
config[key] = myValue
|
||||
}
|
||||
})
|
||||
this.copyConfig = '// 自定义配置,参考 ./default/setting.js,需要自定义的属性在这里配置即可\n'
|
||||
this.copyConfig = '// 自定义配置,参考 ./default/setting.config.js,需要自定义的属性在这里配置即可\n'
|
||||
this.copyConfig += 'module.exports = '
|
||||
this.copyConfig += formatConfig(config)
|
||||
|
||||
let clipboard = new Clipboard('#copyBtn')
|
||||
const _this = this
|
||||
clipboard.on('success', function () {
|
||||
_this.$message.success(`复制成功`)
|
||||
_this.$message.success(`复制成功,覆盖文件 src/config/config.js 然后重启项目即可生效`)
|
||||
clipboard.destroy()
|
||||
})
|
||||
},
|
||||
|
||||
@@ -28,6 +28,7 @@ module.exports = {
|
||||
},
|
||||
animate: {
|
||||
title: '页面切换动画',
|
||||
disable: '禁用动画',
|
||||
effect: '动画效果',
|
||||
direction: '动画方向'
|
||||
},
|
||||
@@ -62,6 +63,7 @@ module.exports = {
|
||||
},
|
||||
animate: {
|
||||
title: '頁面切換動畫',
|
||||
disable: '禁用動畫',
|
||||
effect: '動畫效果',
|
||||
direction: '動畫方向'
|
||||
},
|
||||
@@ -96,6 +98,7 @@ module.exports = {
|
||||
},
|
||||
animate: {
|
||||
title: 'Page Toggle Animation',
|
||||
disable: 'Disable',
|
||||
effect: 'Effect',
|
||||
direction: 'Direction'
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<transition
|
||||
:enter-active-class="`animated ${enterAnimate} page-toggle-enter-active`"
|
||||
:leave-active-class="`animated ${leaveAnimate} page-toggle-leave-active`"
|
||||
:enter-active-class="disabled ? 'animate-disabled' : `animated ${enterAnimate} page-toggle-enter-active`"
|
||||
:leave-active-class="disabled ? 'animate-disabled' : `animated ${leaveAnimate} page-toggle-leave-active`"
|
||||
>
|
||||
<slot></slot>
|
||||
</transition>
|
||||
@@ -13,6 +13,10 @@
|
||||
export default {
|
||||
name: 'PageToggleTransition',
|
||||
props: {
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
animate: {
|
||||
type: String,
|
||||
validator(value) {
|
||||
|
||||
Reference in New Issue
Block a user