123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <template>
- <view class="top-tabs">
- <tui-tabs
- :tabs="tabs"
- itemWidth="33.3333%"
- :currentTab="currentTab"
- @change="change"
- :isFixed="true"
- selectedColor="#ff457b"
- sliderBgColor="#ff457b"
- ></tui-tabs>
- </view>
- </template>
- <script>
- export default {
- name: 'goods-top-tabs',
- props: {
- current: {
- type: Number,
- default: 0
- }
- },
- data() {
- return {
- currentTab: 0,
- tabs: [
- {
- name: '商品'
- },
- {
- name: '详情'
- },
- {
- name: '服务项目'
- }
- ]
- }
- },
- watch: {
- current: {
- handler: function(nVal) {
- this.currentTab = nVal
- },
- immediate: true
- }
- },
- methods: {
- change(e) {
- this.currentTab = e.index
- this.$emit('change', this.currentTab)
- }
- }
- }
- </script>
- <style lang="scss" scoped></style>
|