The front-end Vue can be customized to freely scroll the beautiful tabs. The label bar title bar can set the background color.

With the development of technology, the complexity of development is getting higher and higher. The traditional development method makes a system into a whole application. It often happens that a small change or the addition of a small function may cause the overall logic to change. The modification affects the whole body. Through component development, individual development and maintenance can be effectively achieved, and they can be combined at will. Greatly improve low development efficiency and reduce maintenance costs.

Componentization is the only way for any front-end application with complex business scenarios and products after multiple iterations. Componentization requires more than just the module splitting and decoupling seen on the surface. There is also a lot of work behind it to support componentization, such as module splitting strategies based on business characteristics, interaction methods between modules, and building systems. etc.

This article introduces a component to you:

The front-end Vue can be customized with free scrolling and exquisite tabs. The label bar title bar can set the background color. To download the complete code, please visit the uni-app plug-in market address: https://ext.dcloud.net.cn/plugin?id=13313

 For more information on front-end components, please follow the WeChat public account: Front-end component development

The renderings are as follows:

format,png

format,png

format,png

format,png

# cc-scrollTag

#### Instructions

```How to use

<!-- tabChange: tab selection event tagList: tab data bgColor: tag background color -->

<cc-scrollTag @tabChange="tabChange" :tagsList="tagList" bgColor="#FA436A"></cc-scrollTag>

```

#### HTML code implementation part

```html

<template>

<view class="content">

<view style="height: 22px;margin: 12px 20px;">Red background sliding tab bar</view>

<!-- tabChange: tab selection event tagList: tab data bgColor: tag background color -->

<cc-scrollTag @tabChange="tabChange" :tagsList="tagList" bgColor="#FA436A"></cc-scrollTag>

<view style="height: 22px;margin: 12px 20px;">Orange background sliding tab bar</view>

<!-- tabChange: tab selection event tagList: tab data bgColor: tag background color -->

<cc-scrollTag @tabChange="tabChange" :tagsList="tagListTwo" bgColor="#f37b1d"></cc-scrollTag>

<view style="height: 22px;margin: 12px 20px;">Pink background sliding tab bar</view>

<!-- tabChange: tab selection event tagList: tab data bgColor: tag background color -->

<cc-scrollTag @tabChange="tabChange" :tagsList="tagList" bgColor="#e03997"></cc-scrollTag>

<view style="height: 22px;margin: 12px 20px;">Green background sliding tab bar</view>

<!-- tabChange: tab selection event tagList: tab data bgColor: tag background color -->

<cc-scrollTag @tabChange="tabChange" :tagsList="tagListTwo" bgColor="#39b54a"></cc-scrollTag>

<view style="height: 22px;margin: 12px 20px;">Yellow background sliding tab bar</view>

<!-- tabChange: tab selection event tagList: tab data bgColor: tag background color -->

<cc-scrollTag @tabChange="tabChange" :tagsList="tagList" bgColor="#fbbd08"></cc-scrollTag>

<view style="height: 22px;margin: 12px 20px;">Olive background sliding tab bar</view>

<!-- tabChange: tab selection event tagList: tab data bgColor: tag background color -->

<cc-scrollTag @tabChange="tabChange" :tagsList="tagListTwo" bgColor="#8dc63f"></cc-scrollTag>

</view>

</template>

<script>

export default {

data() {

return {

tagList: [

'Homepage', 'Title 1', 'Title 2', 'Title 3', 'Title 4',

'Title 5', 'Title 6',

'Title 7', 'Title 8'

],

tagListTwo: [

'recommend',

'Option 1',

'Option 2',

'Option three',

'Option four',

'Option five',

'Option six',

'Option seven',

'Option eight',

],

}

},

onLoad() {

},

methods: {

tabChange: function(t) {

console.log("tab selection sequence = " + JSON.stringify(t));

},

}

}

</script>

<style>

.content {

display: flex;

flex-direction: column;

}

</style>

```

Guess you like

Origin blog.csdn.net/chenchuang0128/article/details/131509224