更新组件演示页面,方便用户直接使用组件,去除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-steps">
<view class="components-steps tn-safe-area-inset-bottom">
<!-- 顶部自定义导航 -->
<tn-nav-bar fixed>Steps步骤条</tn-nav-bar>
@@ -8,9 +8,46 @@
<!-- 页面内容 -->
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
<dynamic-demo-template ref="demoTemplate" :tips="tips" :sectionList="sectionList" :full="true" @click="click">
<tn-steps :list="list" :current="current" :mode="mode" :direction="direction" :showTitle="showTitle" :activeColor="activeColor" :inActiveColor="inActiveColor"></tn-steps>
</dynamic-demo-template>
<view class="operate_btn">
<view>
<tn-button backgroundColor="tn-bg-indigo" fontColor="tn-color-white" @click="prevStep">上一步</tn-button>
</view>
<view>
<tn-button backgroundColor="#01BEFF" fontColor="tn-color-white" @click="nextStep">下一步</tn-button>
</view>
</view>
<view class="tn-padding-top-lg"></view>
<demo-title title="点模式">
<tn-steps :list="list" :current="current" @click="stepItemClick"></tn-steps>
</demo-title>
<demo-title title="数值模式">
<tn-steps :list="list" :current="current" mode="number" @click="stepItemClick"></tn-steps>
</demo-title>
<demo-title title="图标模式">
<tn-steps :list="list" :current="current" mode="icon" @click="stepItemClick"></tn-steps>
</demo-title>
<demo-title title="点图标模式">
<tn-steps :list="list" :current="current" mode="dotIcon" @click="stepItemClick"></tn-steps>
</demo-title>
<demo-title title="隐藏标题">
<tn-steps :list="list" :current="current" mode="icon" :showTitle="false" @click="stepItemClick"></tn-steps>
</demo-title>
<demo-title title="自定义颜色">
<tn-steps :list="list" :current="current" mode="icon" activeColor="#24F083" inActiveColor="#E6E6E6" @click="stepItemClick"></tn-steps>
</demo-title>
<demo-title title="垂直显示">
<tn-steps :list="list" :current="current" direction="column" @click="stepItemClick"></tn-steps>
</demo-title>
<view class="tn-padding-bottom-lg"></view>
</view>
@@ -19,10 +56,10 @@
</template>
<script>
import dynamicDemoTemplate from '@/libs/components/dynamic-demo-template.vue'
import demoTitle from '@/libs/components/demo-title.vue'
export default {
name: 'componentsSteps',
components: {dynamicDemoTemplate},
components: {demoTitle},
data() {
return {
list: [
@@ -31,112 +68,38 @@
{name: '第三步', icon: 'safe', selectIcon: 'safe-fill'},
{name: '第四步', icon: 'vip', selectIcon: 'vip-fill'}
],
current: 0,
mode: 'dot',
direction: 'row',
showTitle: true,
activeColor: '#01BEFF',
inActiveColor: '#AAAAAA',
tips: ['无需依赖额外的样式文件','使用tn-steps组件'],
sectionList: [
{
name: '参数切换',
section: [
{
title: '步骤',
optional: ['上一步','下一步'],
methods: 'currentChange',
current: 1
},
{
title: '模式',
optional: ['点模式','数值模式','图标模式','点图标模式'],
methods: 'modeChange'
},
{
title: '方向',
optional: ['横向','竖直'],
methods: 'directionChange'
},
{
title: '显示标题',
optional: ['显示','隐藏'],
methods: 'showTitleChange'
},
{
title: '自定义颜色',
optional: ['默认','自定义'],
methods: 'colorChange'
}
]
}
]
current: 0
}
},
methods: {
click(event) {
this[event.methods] && this[event.methods](event)
},
// 切换步骤
currentChange(event) {
prevStep() {
let current = this.current
if (event.index === 0) {
current--
this.current = current < 0 ? 0 : current
} else {
current++
this.current = current > this.list.length ? this.list.length : current
}
current--
this.current = current < 0 ? 0 : current
},
// 切换模式
modeChange(event) {
switch (event.index) {
case 0:
this.mode = 'dot'
break
case 1:
this.mode = 'number'
break
case 2:
this.mode = 'icon'
break
case 3:
this.mode = 'dotIcon'
break
}
this.$refs.demoTemplate.updateSectionScrollView()
nextStep() {
let current = this.current
current++
this.current = current > this.list.length ? this.list.length : current
},
// 切换方向
directionChange(event) {
this.direction = event.index === 0 ? 'row' : 'column'
this.$refs.demoTemplate.updateSectionScrollView()
},
// 切换标题情况
showTitleChange(event) {
this.showTitle = event.index === 0 ? true : false
this.$refs.demoTemplate.updateSectionScrollView()
},
// 切换颜色样式
colorChange(event) {
switch(event.index) {
case 0:
this.activeColor = '#01BEFF'
this.inActiveColor = '#AAAAAA'
break
case 1:
this.activeColor = '#24F083'
this.inActiveColor = '#E6E6E6'
break
}
stepItemClick(e) {
this.current = e.index
}
},
}
}
</script>
<style lang="scss" scoped>
.operate_btn {
position: fixed;
width: 100%;
padding: 0 30rpx;
margin: 30rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 1000;
}
</style>