Comments (2)
还有两个优化点:
1、加个参数textSelectSize,设置tab字体选中的大小
2、指示器与文字的间距,如图:
from eeui.
【已解决】
@kuaifan 提供的方案
完全自定义方法:
<template>
<div class="app">
<div class="nav">
<template v-for="(item, index) in tabPages">
<text :class="[index === position ? 'nav-active' : 'nav-item']" @click="switchPage(index)">{{item.title}}</text>
<text v-if="index < tabPages.length - 1" class="nav-line"></text>
</template>
</div>
<tabbar
ref="reflectName"
class="tabbar"
:eeui="{ tabType: 'top', tabHeight: 0 }"
:tabPages="tabPages"
@pageSelected="pageSelected"></tabbar>
</div>
</template>
<style>
.app {
flex: 1
}
.nav {
width: 750px;
height: 100px;
background-color: #3EB4FF;
flex-direction: row;
justify-content: center;
align-items: center;
}
.nav-item,
.nav-active {
width: 120px;
height: 100px;
line-height: 100px;
text-align: center;
font-size: 28px;
color: #ffffff;
font-weight: 300;
}
.nav-active {
color: #E1C040;
font-weight: 600;
border-bottom-width: 6px;
border-bottom-style: solid;
border-bottom-color: #E1C040;
}
.nav-line {
height: 24px;
width: 1px;
background-color: #ffffff;
}
.tabbar {
flex: 1;
width: 750px;
}
</style>
<script>
export default {
data() {
return {
position: 0,
tabPages: [
{
tabName: 'home',
title: '首页',
url: 'http://dotwe.org/raw/dist/b5fd96d8d790f0100bdfc20b93eedf09.bundle.wx',
},
{
tabName: 'friend',
title: '好友',
url: 'http://dotwe.org/raw/dist/ba938c9aaebe41e5f60b98f90bd0bf61.bundle.wx',
},
{
tabName: 'group',
title: '圈子',
url: 'http://dotwe.org/raw/dist/fb6f016b0116969b6b503e1d3a35285f.bundle.wx',
},
{
tabName: 'setting',
title: '设置',
url: 'http://dotwe.org/raw/dist/ad0045a7cff0b3a680d9de6dd4806e81.bundle.wx',
},
],
}
},
methods: {
pageSelected(data) {
this.position = data.position;
},
switchPage(index) {
this.position = index;
this.$refs.reflectName.setCurrentItem(this.tabPages[index].tabName);
}
}
};
</script>
from eeui.
Related Issues (20)
- 第三方页面,需要调用eeui上的原生功能,如何通信
- 朋友们,你们的努力方向错了,我们讨论一下,改个方向才有前途 HOT 6
- eeui.openPage softInputMode:'nothing' keyboard事件丢失
- eeui/lottie. 忽略
- How to reduce output (apk/ipa) size? HOT 5
- when I create new project, this happened
- error when i use "eeui run android"
- h5与原生插件交互,onJsPrompt方法所能接收的message最大10kb左右,超过自动截断数据,有什么解决办法?
- Android新手挖坑指南 HOT 1
- 安卓11,用了toast组件后闪退。 HOT 2
- component SideDrawer?
- BUG: android build never finish HOT 1
- Android端
- Android端:场景示例:目前顺序打开a、b、c、d四个页面,d为当前页面,打开第五个页面e,需要关闭前面a、b、c、d四个页面,如何实现 HOT 1
- 下载的模板2.5.0出现,CMake Error: The source directory "../plugins/eeui/WeexSDK/android/sdk/src/legacyRelease/cpp" does not exist.这个问题怎么回事
- 不维护了吗,好尴尬 HOT 2
- 怎么设置首页状态栏的背景色 HOT 2
- appboard下面使用import引入其他js文件的时候报错,ReferenceError: Can't find variable: require HOT 1
- as 连接真机编译debug的问题
- dependency app.eeui:zxing:1.0.2的maven仓库地址无法访问
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eeui.