12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <template>
- <view
- class="u-steps"
- :class="[`u-steps--${direction}`]"
- >
- <slot></slot>
- </view>
- </template>
- <script>
- import props from './props.js';
- import mpMixin from '../../libs/mixin/mpMixin.js';
- import mixin from '../../libs/mixin/mixin.js';
-
- 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 => {
-
- uni.$u.test.func((child || {}).updateFromParent()) && child.updateFromParent()
- })
- },
-
- updateFromChild() {
- this.updateChildData()
- }
- },
- created() {
- this.children = []
- }
- }
- </script>
- <style lang="scss" scoped>
- @import "../../libs/css/components.scss";
- .u-steps {
- @include flex;
- &--column {
- flex-direction: column
- }
- &--row {
- flex-direction: row;
- flex: 1;
- }
- }
- </style>
|