更新组件演示页面,方便用户直接使用组件,去除tn-button的默认背景色,tn-avatar修改参数默认值,修复tn-avatar-group最开始头像进行了偏移、修复无法使用标签的bug,tn-badge修改参数默认值,tn-collapse-item修复背景颜色失效问题,滚动通知移除默认背景颜色和字体大小,tn-count-down修复时间单位不正确问题,列表组件修复背景颜色问题,tn-nav-bar返回按钮修改为可进行修改的图标,tn-step添加点击步骤进行跳转,tn-loading修复默认激活颜色出错问题,tn-tag移除默认背景颜色,优化阴影大小css

This commit is contained in:
JaylenTech
2022-02-08 19:55:15 +08:00
parent 043ee3f585
commit 946bb52c03
94 changed files with 6296 additions and 4727 deletions

View File

@@ -1,6 +1,6 @@
<template>
<view class="components-count_scroll">
<view class="components-count_scroll tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>countScroll数字滚动</tn-nav-bar>
@@ -8,16 +8,37 @@
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="false" @click="click">
<tn-count-scroll
:value="value"
:height="height"
:fontColor="fontColor"
:fontSize="fontSize"
:bold="bold"
:duration="duration"
></tn-count-scroll>
</dynamic-demo-template>
<demo-title title="基本使用">
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
<view>
<tn-count-scroll :value="888.88"></tn-count-scroll>
</view>
<view class="tn-margin-left">
<tn-count-scroll :value="9999"></tn-count-scroll>
</view>
</view>
</demo-title>
<demo-title title="加长持续时间">
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
<view>
<tn-count-scroll :value="888.88" :duration="0.5"></tn-count-scroll>
</view>
<view class="tn-margin-left">
<tn-count-scroll :value="9999" :duration="3"></tn-count-scroll>
</view>
</view>
</demo-title>
<demo-title title="字体加大加粗">
<tn-count-scroll :value="888.88" :height="100" :fontSize="100" :bold="true"></tn-count-scroll>
</demo-title>
<demo-title title="自定义颜色">
<tn-count-scroll :value="888.88" fontColor="#E88C30"></tn-count-scroll>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
@@ -26,85 +47,22 @@
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsCountTo',
components: {dynamicDemoTemplate},
components: {demoTitle},
data() {
return {
value: 888.88,
height: 32,
fontColor: '#080808',
fontSize: 32,
bold: false,
duration: 1.2,
tips: ['无需依赖额外的样式文件','使用tn-count-scroll组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '值',
optional: ['90','1234','888.88'],
methods: 'valueChange',
current: 2
},
{
title: '持续时间',
optional: ['默认','0.5', '3'],
methods: 'durationChange'
},
{
title: '加粗',
optional: ['默认','加粗'],
methods: 'boldChange'
},
{
title: '自定义样式',
optional: ['默认','自定义'],
methods: 'customStyleChange'
}
]
}
]
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 切换值
valueChange(event) {
this.value = Number(event.name)
},
// 切换持续时间
durationChange(event) {
this.duration = event.index === 0 ? 1.2 : Number(event.name)
},
// 切换加粗
boldChange(event) {
this.bold = event.index === 0 ? false : true
},
// 切换自定义样式
customStyleChange(event) {
switch(event.index) {
case 0:
this.height = 32
this.fontColor = '#080808'
this.fontSize = 32
break
case 1:
this.height = 80
this.fontColor = '#E88C30'
this.fontSize = 80
break
}
},
},
}
}
</script>
<style lang="scss" scoped>
.components-count_scroll {
min-height: 100vh;
}
</style>