123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <template>
- <view
- class="u-steps"
- :class="[`u-steps--${direction}`]"
- >
- <slot></slot>
- </view>
- </template>
- <script>
- import { props } from './props';
- import { mpMixin } from '../../libs/mixin/mpMixin';
- import { mixin } from '../../libs/mixin/mixin';
- import test from '../../libs/function/test';
-
- export default {
- name: 'u-steps',
- mixins: [mpMixin, mixin, props],
- data() {
- return {
- }
- },
- watch: {
- children() {
- this.updateChildData()
- },
- parentData() {
- this.updateChildData()
- }
- },
- computed: {
-
- parentData() {
- return [this.current, this.direction, this.activeColor, this.inactiveColor, this.activeIcon, this.inactiveIcon, this.dot]
- }
- },
- methods: {
-
- updateChildData() {
- this.children.map(child => {
-
- test.func((child || {}).updateFromParent()) && child.updateFromParent()
- })
- },
-
- updateFromChild() {
- this.updateChildData()
- }
- },
- created() {
- this.children = []
- },
- options: {
- virtualHost: false
- }
- }
- </script>
- <style lang="scss" scoped>
- @import "../../libs/css/components.scss";
- .u-steps {
- @include flex;
- &--column {
- flex-direction: column
- }
- &--row {
- flex-direction: row;
- flex: 1;
- /* #ifdef MP */
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
- /* #endif */
- }
- }
- </style>
|