diff --git a/pages.json b/pages.json index 18c2f3e..4bf5776 100644 --- a/pages.json +++ b/pages.json @@ -43,5 +43,14 @@ "navigationBarTitleText": "uni-app", "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" - } + }, + "rightWindow": { + "path": "responsive/right-window.vue", + "style": { + "width": "calc(100vw - 450px)" + }, + "matchMedia": { + "minWidth": 768 + } + } } diff --git a/pages/Sub/Tabs/Tabs.vue b/pages/Sub/Tabs/Tabs.vue index 8254285..198175a 100644 --- a/pages/Sub/Tabs/Tabs.vue +++ b/pages/Sub/Tabs/Tabs.vue @@ -4,31 +4,47 @@ Tabs - - - - - 2{{data.text}} + + + + - + + + + - + 点击 + @@ -43,7 +59,7 @@ formData:{ buildingArea: '' }, - active: 0, + active: 2, fiveList: [ { text: "金吒" }, { text: "木吒" }, @@ -70,7 +86,21 @@ ] }; },methods: { + cilck(){ + this.fiveList = [ + { text: "金吒" }, + { text: "木吒" }, + { text: "土吒" }, + { text: "土吒" }, + { text: "土吒" }, + { text: "土吒22222" }, + { text: "土吒" }, + { text: "土吒" }, + { text: "土吒" }, + ] + }, change(index) { + console.log(index); } }, } diff --git a/pages/index/index.vue b/pages/index/index.vue index b74c884..b3bf1b9 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,5 +1,5 @@ - + 爱能森组件库 @@ -25,21 +25,18 @@ sadsa - + - - {{text.length}}/{{maxlength}} - {{text}} - + + {{$n}} - @@ -48,22 +45,13 @@ export default { data() { return { - text: '', - maxlength: 200 + text: '' } }, onReady() { }, methods: { - adjust(){ - // let value = this.text - // value = value.replace(/\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g, ""); - // if(value.length>this.maxlength) { - // value = value.slice(0, this.maxlength); - // } - // this.text = value - }, go(path) { uni.navigateTo({ url: path diff --git a/responsive/right-window.vue b/responsive/right-window.vue new file mode 100644 index 0000000..5de56f2 --- /dev/null +++ b/responsive/right-window.vue @@ -0,0 +1,29 @@ + + + + + + + + + \ No newline at end of file diff --git a/uni_modules/niu-ui/components/niu-navbar/niu-navbar.vue b/uni_modules/niu-ui/components/niu-navbar/niu-navbar.vue index 02b755b..1acff29 100644 --- a/uni_modules/niu-ui/components/niu-navbar/niu-navbar.vue +++ b/uni_modules/niu-ui/components/niu-navbar/niu-navbar.vue @@ -175,7 +175,6 @@ // #endif }, created() { - this.$n.navbar.top = this.getNavbarHeight() // #ifdef MP let statusBarHeight = uni.getSystemInfoSync().statusBarHeight; let menuButtonInfo = uni.getMenuButtonBoundingClientRect() @@ -189,6 +188,7 @@ // #endif }, mounted() { + this.$set(this.$n.data, "navbarTop", this.getNavbarHeight()) let pages = getCurrentPages(); if (pages.length == 1 && mainPagePath.includes(pages[0].route)) { this.firstPage = true; diff --git a/uni_modules/niu-ui/components/niu-tabs/niu-tabs.vue b/uni_modules/niu-ui/components/niu-tabs/niu-tabs.vue index 8705a6b..17979b5 100644 --- a/uni_modules/niu-ui/components/niu-tabs/niu-tabs.vue +++ b/uni_modules/niu-ui/components/niu-tabs/niu-tabs.vue @@ -1,26 +1,30 @@ - + - + - + + {{item[akey]}} - + @@ -48,7 +52,7 @@ }, width: { type: String, - default: 'auto' + default: '' }, height: { type: String, @@ -116,9 +120,10 @@ anim: false, left: 0, isRender: false, + isShow: false, allLeft: [], barLeft: 0, - barWidth: 200, + barWidth: 0, x_ml: 0 // 容器距离左侧屏幕的距离 }; }, @@ -144,11 +149,12 @@ } }, mounted() { - this.init() + this.init(this.value) }, watch: { list(newValue, oldValue) { - this.init() + this.anim = false + this.init(this.value) }, value(newValue, oldValue) { if (this.isRender) return @@ -169,8 +175,11 @@ return [v.left - this.x_ml, v.width] }) this.isRender = false - this.clickHere(index) - this.left = index != 0 ? (this.allLeft[index][0]) : 0; + if(index < this.list.length){ + this.clickHere(index) + this.left = index != 0 ? (this.allLeft[index][0] - this.allLeft[index][1] * 2) : 0; + } + this.isShow = true setTimeout(()=>{ this.anim = true },300) @@ -254,6 +263,7 @@ .niu-x-tabs__item { flex: 1; + width: 0; text-align: center; } } @@ -297,7 +307,7 @@ position: absolute; bottom: 0; left: 0; - width: 50rpx; + width: 0; height: 2px; background-color: $themeColor; diff --git a/uni_modules/niu-ui/index.js b/uni_modules/niu-ui/index.js index b87bbe4..e7b19ff 100644 --- a/uni_modules/niu-ui/index.js +++ b/uni_modules/niu-ui/index.js @@ -3,13 +3,10 @@ import toast from "./extensions/toast" export default { install(Vue) { - const navbarData = Vue.observable({ - top: 0 - }) - Vue.prototype.$n = { - navbar: navbarData, + Vue.prototype.$n = Vue.observable({ + data: {}, util: util, toast: toast - } + }) } }