mirror of
https://gitee.com/TSpecific/tuniao-ui.git
synced 2026-03-08 00:34:01 +08:00
更新组件演示页面,方便用户直接使用组件,去除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:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<view class="components-count_to">
|
||||
<view class="components-count_to tn-safe-area-inset-bottom">
|
||||
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>countTo数字跳转</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-to
|
||||
:startVal="startVal"
|
||||
:endVal="endVal"
|
||||
:fontColor="fontColor"
|
||||
:fontSize="fontSize"
|
||||
:decimals="decimals"
|
||||
:bold="bold"
|
||||
></tn-count-to>
|
||||
</dynamic-demo-template>
|
||||
<demo-title title="基本使用">
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
|
||||
<view>
|
||||
<tn-count-to :startVal="0" :endVal="1000"></tn-count-to>
|
||||
</view>
|
||||
<view class="tn-margin-left">
|
||||
<tn-count-to :startVal="100" :endVal="2000"></tn-count-to>
|
||||
</view>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="显示小数">
|
||||
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
|
||||
<view>
|
||||
<tn-count-to :startVal="0" :endVal="1000.9" :decimals="1"></tn-count-to>
|
||||
</view>
|
||||
<view class="tn-margin-left">
|
||||
<tn-count-to :startVal="0" :endVal="1000.99" :decimals="2"></tn-count-to>
|
||||
</view>
|
||||
</view>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="字体加大加粗显示">
|
||||
<tn-count-to :startVal="0" :endVal="1000" :bold="true" :fontSize="100"></tn-count-to>
|
||||
</demo-title>
|
||||
|
||||
<demo-title title="自定义字体颜色">
|
||||
<tn-count-to :startVal="0" :endVal="1000" fontColor="#A4E82F"></tn-count-to>
|
||||
</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 {
|
||||
fontColor: '#080808',
|
||||
fontSize: 50,
|
||||
startVal: 0,
|
||||
endVal: 1000,
|
||||
duration: 2000,
|
||||
decimals: 0,
|
||||
bold: false,
|
||||
|
||||
tips: ['无需依赖额外的样式文件','使用tn-count-to组件'],
|
||||
sectionList: [
|
||||
{
|
||||
name: '参数切换',
|
||||
section: [
|
||||
{
|
||||
title: '滚动范围',
|
||||
optional: ['0-1000','100-2500'],
|
||||
methods: 'valChange'
|
||||
},
|
||||
{
|
||||
title: '小数显示位数',
|
||||
optional: ['不显示','1','2'],
|
||||
methods: 'decimalsChange'
|
||||
},
|
||||
{
|
||||
title: '加粗',
|
||||
optional: ['默认','加粗'],
|
||||
methods: 'boldChange'
|
||||
},
|
||||
{
|
||||
title: '自定义样式',
|
||||
optional: ['默认','自定义'],
|
||||
methods: 'customStyleChange'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
click(event) {
|
||||
this[event.methods] && this[event.methods](event)
|
||||
},
|
||||
// 切换开始结束值
|
||||
valChange(event) {
|
||||
const value = event.name.split('-')
|
||||
this.startVal = Number(value[0])
|
||||
this.endVal = Number(value[1])
|
||||
},
|
||||
// 切换小数显示
|
||||
decimalsChange(event) {
|
||||
this.decimals = event.index === 0 ? 0 : Number(event.name)
|
||||
},
|
||||
// 切换加粗
|
||||
boldChange(event) {
|
||||
this.bold = event.index === 0 ? false : true
|
||||
},
|
||||
// 切换自定义样式
|
||||
customStyleChange(event) {
|
||||
switch(event.index) {
|
||||
case 0:
|
||||
this.fontColor = '#080808'
|
||||
this.fontSize = 50
|
||||
break
|
||||
case 1:
|
||||
this.fontColor = '#A4E82F'
|
||||
this.fontSize = 100
|
||||
break
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.components-count_to {
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user