Browse Source

commit

Signed-off-by: 1549469775 <1549469775@qq.com>
master
1549469775 3 years ago
parent
commit
7bfc9e81f9
  1. 1
      App.vue
  2. 238
      assets/style/common.scss
  3. 215
      assets/style/global.scss
  4. 2
      main.js
  5. 5
      pages.json
  6. 148
      pages/Sub/Tabs/Tabs.vue
  7. 7
      pages/index/index.vue
  8. 8
      readme.md
  9. 2
      uni.scss
  10. 111
      uni_modules/niu-ui/assets/style/common.scss
  11. 1
      uni_modules/niu-ui/assets/style/global.scss
  12. 4
      uni_modules/niu-ui/changelog.md
  13. 2
      uni_modules/niu-ui/components/niu-navbar/niu-navbar.vue
  14. 16
      uni_modules/niu-ui/components/niu-page/niu-page.vue
  15. 9
      uni_modules/niu-ui/components/niu-tabs/niu-tabs.vue
  16. 8
      uni_modules/niu-ui/components/niu-ui/niu-ui.vue
  17. 7
      uni_modules/niu-ui/index.js
  18. 12
      uni_modules/niu-ui/package.json
  19. 7
      uni_modules/niu-ui/readme.md

1
App.vue

@ -15,4 +15,5 @@
<style lang="scss"> <style lang="scss">
/*每个页面公共css */ /*每个页面公共css */
@import '~@/assets/style/common.scss'; @import '~@/assets/style/common.scss';
@import '~@/uni_modules/niu-ui/assets/style/common.scss'
</style> </style>

238
assets/style/common.scss

@ -1,145 +1,97 @@
page {
// background-color: #FFF8F8;
background-color: #F1F1F1;
// min-height: 100%;
height: 100%;
font-size: 28rpx;
line-height: 1.2; //
color: #000;
}
page .tabpage{ // .a-flexbox{
// 怪异盒模型 // display: flex;
-webkit-overflow-scrolling: touch; // &.a-flexbox--fixed{
box-sizing: border-box; // flex-shrink: 0;
/* #ifdef H5 */ // flex-grow: 0;
//貌似不需要了已经是去除了tabbar的高度了 // }
//自定义tabbar的时候需要 // &.a-flexbox--inline{
// 底部tab栏高度 // display: inline-flex;
margin-bottom: 0;//var(--window-bottom); // }
/* #endif */ // &.a-flexbox__column{
/* #ifndef H5 */ // flex-direction: column;
margin-bottom: 0; // }
/* #endif */ // &.a-flexbox__row{
// 触发BFC // flex-direction: row;
// overflow-x: hidden; // }
// overflow-y: scroll; // &.a-flexbox__wrap{
min-height: 100%; // flex-wrap: wrap;
} // }
page .page{ // &.a-flexbox__center{
// 怪异盒模型 // align-items: center;
-webkit-overflow-scrolling: touch; // justify-content: center;
box-sizing: border-box; // }
// 触发BFC // &.a-flexbox__center--x{
// overflow-x: hidden; // justify-content: center;
// overflow-y: scroll; // }
min-height: 100%; // &.a-flexbox--around{
} // justify-content: space-around;
// }
// &.a-flexbox--between{
// justify-content: space-between;
// }
// &.a-flexbox__start--x{
// justify-content: flex-start;
// }
// &.a-flexbox__end--x{
// justify-content: flex-end;
// }
// &.a-flexbox__center--y{
// align-items: center;
// }
// &.a-flexbox__start--y{
// align-items: flex-start;
// }
// &.a-flexbox__end--y{
// align-items: flex-end;
// }
// .a-flexbox__noshrink{
// flex-shrink: 0;
// }
// .a-flexbox__full{
// flex: 1;
// width: 0;
// }
// .a-flexbox__full--h{
// flex: 1;
// height: 0;
// }
// }
// // 单行省略号
// .a-ov{
// @include ellipsis(1)
// }
// // 两行省略号
// .a-ov2{
// @include ellipsis(2)
// }
::-webkit-scrollbar { // // 包裹输入框
width: 0; // .a-wrapinput{
height: 0; // position:relative;
color: transparent; // display: flex;
display: none; // align-items: center;
} // // height: 100%;
// >input{
page *{ // width: 0;
box-sizing: border-box; // flex: 1;
} // // height: 100%;
// font-size: inherit;
.a-flexbox{ // line-height: inherit;
display: flex; // }
&.a-flexbox--fixed{ // .sub{
flex-shrink: 0; // display: flex;
flex-grow: 0; // align-items: center;
} // margin-right: 8rpx;
&.a-flexbox--inline{ // }
display: inline-flex; // }
} // // 包裹文本域
&.a-flexbox__column{ // .a-wraptextarea{
flex-direction: column; // min-height: 160rpx;
} // height: 160rpx;
&.a-flexbox__row{ // >textarea{
flex-direction: row; // font-size: inherit;
} // width: 100%;
&.a-flexbox__wrap{ // height: 100%;
flex-wrap: wrap; // }
} // }
&.a-flexbox__center{
align-items: center;
justify-content: center;
}
&.a-flexbox__center--x{
justify-content: center;
}
&.a-flexbox--around{
justify-content: space-around;
}
&.a-flexbox--between{
justify-content: space-between;
}
&.a-flexbox__start--x{
justify-content: flex-start;
}
&.a-flexbox__end--x{
justify-content: flex-end;
}
&.a-flexbox__center--y{
align-items: center;
}
&.a-flexbox__start--y{
align-items: flex-start;
}
&.a-flexbox__end--y{
align-items: flex-end;
}
.a-flexbox__noshrink{
flex-shrink: 0;
}
.a-flexbox__full{
flex: 1;
width: 0;
}
.a-flexbox__full--h{
flex: 1;
height: 0;
}
}
// 单行省略号
.a-ov{
@include ellipsis(1)
}
// 两行省略号
.a-ov2{
@include ellipsis(2)
}
// 包裹输入框
.a-wrapinput{
position:relative;
display: flex;
align-items: center;
// height: 100%;
>input{
width: 0;
flex: 1;
// height: 100%;
font-size: inherit;
line-height: inherit;
}
.sub{
display: flex;
align-items: center;
margin-right: 8rpx;
}
}
// 包裹文本域
.a-wraptextarea{
min-height: 160rpx;
height: 160rpx;
>textarea{
font-size: inherit;
width: 100%;
height: 100%;
}
}

215
assets/style/global.scss

@ -1,112 +1,113 @@
/* // /*
* 内部通用scss // * 内部通用scss
*/ // */
@mixin clearfix { // @mixin clearfix {
&:after { // &:after {
clear: both; // clear: both;
content: '.'; // content: '.';
display: block; // display: block;
height: 0; // height: 0;
line-height: 0; // line-height: 0;
overflow: hidden; // overflow: hidden;
} // }
// *height: 1%; // // *height: 1%;
} // }
@mixin hairline { // @mixin hairline {
&::after { // &::after {
content: " "; // content: " ";
box-sizing: border-box; // box-sizing: border-box;
pointer-events: none; // pointer-events: none;
border: 0 solid #ebedf0; // border: 0 solid #ebedf0;
position: absolute; // position: absolute;
top: -50%; // top: -50%;
right: -50%; // right: -50%;
bottom: -50%; // bottom: -50%;
left: -50%; // left: -50%;
-webkit-transform: scale(0.5); // -webkit-transform: scale(0.5);
transform: scale(0.5); // transform: scale(0.5);
@content // @content
} // }
}; // };
@mixin hairline--no { // @mixin hairline--no {
@include hairline{ // @include hairline{
border: 0; // border: 0;
}; // };
} // }
@mixin hairline--all { // @mixin hairline--all {
@include hairline{ // @include hairline{
border-width: 1px; // border-width: 1px;
}; // };
} // }
@mixin hairline--right { // @mixin hairline--right {
@include hairline{ // @include hairline{
border-right-width: 1px; // border-right-width: 1px;
}; // };
} // }
@mixin hairline--left { // @mixin hairline--left {
@include hairline{ // @include hairline{
border-left-width: 1px; // border-left-width: 1px;
}; // };
} // }
@mixin hairline--bottom {
@include hairline{
border-bottom-width: 1px;
};
}
@mixin hairline--top { // @mixin hairline--bottom {
@include hairline{ // @include hairline{
border-top-width: 1px; // border-bottom-width: 1px;
}; // };
} // }
@mixin hairline--right--bottom {
@include hairline{
border-left-width: 0;
border-top-width: 0;
border-right-width: 1px;
border-bottom-width: 1px;
};
}
@mixin hairline--left--top {
@include hairline{
border-right-width: 0;
border-bottom-width: 0;
border-left-width: 1px;
border-top-width: 1px;
};
}
//一行溢出
@mixin text-overflow{
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
};
//两行溢出 // @mixin hairline--top {
@mixin ov($num: 2){ // @include hairline{
text-overflow: -o-ellipsis-lastline; // border-top-width: 1px;
overflow: hidden; // };
text-overflow: ellipsis; // }
display: -webkit-box; // @mixin hairline--right--bottom {
-webkit-line-clamp: $num; // @include hairline{
line-clamp: $num; // border-left-width: 0;
-webkit-box-orient: vertical; // border-top-width: 0;
} // border-right-width: 1px;
@mixin ellipsis($lines: 1) { // border-bottom-width: 1px;
@if ($lines==1) { // };
overflow: hidden; // }
text-overflow: ellipsis; // @mixin hairline--left--top {
white-space: nowrap; // @include hairline{
} @else { // border-right-width: 0;
display: -webkit-box; // border-bottom-width: 0;
-webkit-box-orient: vertical; // border-left-width: 1px;
-webkit-line-clamp: $lines; // border-top-width: 1px;
overflow: hidden; // };
text-overflow: ellipsis; // }
word-break: break-all; // //一行溢出
} // @mixin text-overflow{
} // white-space: nowrap;
// text-overflow: ellipsis;
// overflow: hidden;
// word-break: break-all;
// };
// //两行溢出
// @mixin ov($num: 2){
// text-overflow: -o-ellipsis-lastline;
// overflow: hidden;
// text-overflow: ellipsis;
// display: -webkit-box;
// -webkit-line-clamp: $num;
// line-clamp: $num;
// -webkit-box-orient: vertical;
// }
// @mixin ellipsis($lines: 1) {
// @if ($lines==1) {
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
// } @else {
// display: -webkit-box;
// -webkit-box-orient: vertical;
// -webkit-line-clamp: $lines;
// overflow: hidden;
// text-overflow: ellipsis;
// word-break: break-all;
// }
// }

2
main.js

@ -13,5 +13,5 @@ Vue.use(niuUI)
const app = new Vue({ const app = new Vue({
...App ...App
}) })
setTimeout(function() {toast.success("asd")}, 10);
app.$mount() app.$mount()

5
pages.json

@ -4,7 +4,10 @@
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "uni-app" "navigationBarTitleText": "uni-app",
"app-plus": {
"bounce": "none"
}
} }
} }
,{ ,{

148
pages/Sub/Tabs/Tabs.vue

@ -1,9 +1,11 @@
<template> <template>
<niu-page> <niu-page>
<niu-navbar fixed color="white" bg="#39b54a"> <niu-navbar fixed color="white" middleLayout='left' bg="#39b54a">
Tabs Tabs
</niu-navbar> </niu-navbar>
<view style="font-size: 35rpx;">
<niu-tabs :list="colorList" @change="change" v-model="active"></niu-tabs> <niu-tabs :list="colorList" @change="change" v-model="active"></niu-tabs>
</view>
<niu-tabs :list="colorList" @change="change" capsule v-model="active"></niu-tabs> <niu-tabs :list="colorList" @change="change" capsule v-model="active"></niu-tabs>
<niu-tabs :list="colorList" :bar="false" @change="change" v-model="active"> <niu-tabs :list="colorList" :bar="false" @change="change" v-model="active">
<template #bar="{show, barLeft, barWidth, anim, props}"> <template #bar="{show, barLeft, barWidth, anim, props}">
@ -25,7 +27,8 @@
</niu-tabs> </niu-tabs>
<niu-tabs :list="fiveList" full :barPer=".8" @change="change" v-model="active"></niu-tabs> <niu-tabs :list="fiveList" full :barPer=".8" @change="change" v-model="active"></niu-tabs>
<niu-tabs :list="fiveList" full :barPer=".8" @change="change" capsule v-model="active"></niu-tabs> <niu-tabs :list="fiveList" full :barPer=".8" @change="change" capsule v-model="active"></niu-tabs>
<niu-tabs :list="colorList" :active-color="colorList[active]&&colorList[active].color" :bar="false" @change="change" v-model="active"> <niu-tabs :list="colorList" :active-color="colorList[active]&&colorList[active].color" :bar="false"
@change="change" v-model="active">
<template #bar="{show, barLeft, barWidth, anim, props, item}"> <template #bar="{show, barLeft, barWidth, anim, props, item}">
<view v-if="show" :style="[ <view v-if="show" :style="[
{ {
@ -58,47 +61,118 @@
}, },
data() { data() {
return { return {
formData:{ formData: {
buildingArea: '' buildingArea: ''
}, },
active: 2, active: 2,
fiveList: [ fiveList: [{
{ text: "金吒" }, text: "金吒"
{ text: "木吒" }, },
{ text: "水吒" }, {
{ text: "火吒" }, text: "木吒"
{ text: "土吒" } },
{
text: "水吒"
},
{
text: "火吒"
},
{
text: "土吒"
}
], ],
colorList: [ colorList: [{
{ text: "嫣红", color: "#e54d42" }, text: "嫣红",
{ text: "桔橙", color: "#f37b1d" }, color: "#e54d42"
{ text: "明黄", color: "#fbbd08" }, },
{ text: "橄榄", color: "#8dc63f" }, {
{ text: "森绿", color: "#39b54a" }, text: "桔橙",
{ text: "天青", color: "#1cbbb4" }, color: "#f37b1d"
{ text: "海蓝", color: "#0081ff" }, },
{ text: "姹紫", color: "#6739b6" }, {
{ text: "木槿", color: "#9c26b0" }, text: "明黄",
{ text: "桃粉", color: "#e03997" }, color: "#fbbd08"
{ text: "棕褐", color: "#a5673f" }, },
{ text: "玄灰", color: "#8799a3" }, {
{ text: "草灰", color: "#aaaaaa" }, text: "橄榄",
{ text: "墨黑", color: "#333333" }, color: "#8dc63f"
{ text: "雅白", color: "#ffffff" }, },
{
text: "森绿",
color: "#39b54a"
},
{
text: "天青",
color: "#1cbbb4"
},
{
text: "海蓝",
color: "#0081ff"
},
{
text: "姹紫",
color: "#6739b6"
},
{
text: "木槿",
color: "#9c26b0"
},
{
text: "桃粉",
color: "#e03997"
},
{
text: "棕褐",
color: "#a5673f"
},
{
text: "玄灰",
color: "#8799a3"
},
{
text: "草灰",
color: "#aaaaaa"
},
{
text: "墨黑",
color: "#333333"
},
{
text: "雅白",
color: "#ffffff"
},
] ]
}; };
},methods: { },
cilck(){ methods: {
this.fiveList = [ cilck() {
{ text: "金吒" }, this.fiveList = [{
{ text: "木吒" }, text: "金吒"
{ text: "土吒" }, },
{ text: "土吒" }, {
{ text: "土吒" }, text: "木吒"
{ text: "土吒22222" }, },
{ text: "土吒" }, {
{ text: "土吒" }, text: "土吒"
{ text: "土吒" }, },
{
text: "土吒"
},
{
text: "土吒"
},
{
text: "土吒22222"
},
{
text: "土吒"
},
{
text: "土吒"
},
{
text: "土吒"
},
] ]
}, },
change(index) { change(index) {

7
pages/index/index.vue

@ -1,7 +1,10 @@
<template> <template>
<niu-page Tab className="wqeqw"> <niu-page Tab>
<niu-navbar fixed :back="false" color="white" bg="#39b54a"> <niu-navbar fixed adjust middleLayout='left' :back="false" color="white" bg="#39b54a">
爱能森组件库 爱能森组件库
<template #right>
asd
</template>
</niu-navbar> </niu-navbar>
<view class="title"> <view class="title">
组件池 组件池

8
readme.md

@ -0,0 +1,8 @@
# niu-ui
第一个版本,目前仅供个人使用
```
import niuUI, {toast} from '@/uni_modules/niu-ui'
Vue.use(niuUI)
```

2
uni.scss

@ -13,7 +13,7 @@
*/ */
/* 颜色变量 */ /* 颜色变量 */
@import '~@/assets/style/global.scss'; @import '~@/uni_modules/niu-ui/assets/style/global.scss';
/* 行为相关颜色 */ /* 行为相关颜色 */
$uni-color-primary: #007aff; $uni-color-primary: #007aff;
$uni-color-success: #4cd964; $uni-color-success: #4cd964;

111
uni_modules/niu-ui/assets/style/common.scss

@ -1,14 +1,12 @@
page { page {
// background-color: #FFF8F8;
background-color: #F1F1F1; background-color: #F1F1F1;
// min-height: 100%;
height: 100%; height: 100%;
font-size: 28rpx; font-size: 28rpx;
line-height: 1.2; // line-height: 1.2; //
color: #000; color: #000;
color: darkred;
} }
page .tabpage {
page .tabpage{
// 怪异盒模型 // 怪异盒模型
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
box-sizing: border-box; box-sizing: border-box;
@ -16,7 +14,7 @@ page {
//貌似不需要了已经是去除了tabbar的高度了 //貌似不需要了已经是去除了tabbar的高度了
//自定义tabbar的时候需要 //自定义tabbar的时候需要
// 底部tab栏高度 // 底部tab栏高度
margin-bottom: 0;//var(--window-bottom); margin-bottom: 0; //var(--window-bottom);
/* #endif */ /* #endif */
/* #ifndef H5 */ /* #ifndef H5 */
margin-bottom: 0; margin-bottom: 0;
@ -26,7 +24,8 @@ page {
// overflow-y: scroll; // overflow-y: scroll;
min-height: 100%; min-height: 100%;
} }
page .page{
page .page {
// 怪异盒模型 // 怪异盒模型
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
box-sizing: border-box; box-sizing: border-box;
@ -43,103 +42,13 @@ page {
display: none; display: none;
} }
page *{ page * {
box-sizing: border-box; box-sizing: border-box;
} }
::-webkit-scrollbar {
.a-flexbox{
display: flex;
&.a-flexbox--fixed{
flex-shrink: 0;
flex-grow: 0;
}
&.a-flexbox--inline{
display: inline-flex;
}
&.a-flexbox__column{
flex-direction: column;
}
&.a-flexbox__row{
flex-direction: row;
}
&.a-flexbox__wrap{
flex-wrap: wrap;
}
&.a-flexbox__center{
align-items: center;
justify-content: center;
}
&.a-flexbox__center--x{
justify-content: center;
}
&.a-flexbox--around{
justify-content: space-around;
}
&.a-flexbox--between{
justify-content: space-between;
}
&.a-flexbox__start--x{
justify-content: flex-start;
}
&.a-flexbox__end--x{
justify-content: flex-end;
}
&.a-flexbox__center--y{
align-items: center;
}
&.a-flexbox__start--y{
align-items: flex-start;
}
&.a-flexbox__end--y{
align-items: flex-end;
}
.a-flexbox__noshrink{
flex-shrink: 0;
}
.a-flexbox__full{
flex: 1;
width: 0; width: 0;
}
.a-flexbox__full--h{
flex: 1;
height: 0; height: 0;
color: transparent;
display: none;
} }
}
// 单行省略号
.a-ov{
@include ellipsis(1)
}
// 两行省略号
.a-ov2{
@include ellipsis(2)
}
// 包裹输入框
.a-wrapinput{
position:relative;
display: flex;
align-items: center;
// height: 100%;
>input{
width: 0;
flex: 1;
// height: 100%;
font-size: inherit;
line-height: inherit;
}
.sub{
display: flex;
align-items: center;
margin-right: 8rpx;
}
}
// 包裹文本域
.a-wraptextarea{
min-height: 160rpx;
height: 160rpx;
>textarea{
font-size: inherit;
width: 100%;
height: 100%;
}
}

1
uni_modules/niu-ui/assets/style/global.scss

@ -51,6 +51,7 @@
border-left-width: 1px; border-left-width: 1px;
}; };
} }
@mixin hairline--bottom { @mixin hairline--bottom {
@include hairline{ @include hairline{
border-bottom-width: 1px; border-bottom-width: 1px;

4
uni_modules/niu-ui/changelog.md

@ -0,0 +1,4 @@
## 0.0.1.alpha.1(2022-07-18)
版本修改
## 0.0.1(2022-07-18)
第一个版本

2
uni_modules/niu-ui/components/niu-navbar/niu-navbar.vue

@ -17,7 +17,7 @@
backgroundColor: !gradient?bg:'transparent' backgroundColor: !gradient?bg:'transparent'
}" :class="[toFixed?'fixed':'',border?'border':'']"> }" :class="[toFixed?'fixed':'',border?'border':'']">
<view v-if="!oneline" class="niu-navbar__left" @click="clickLeft" <view v-if="!oneline" class="niu-navbar__left" @click="clickLeft"
:style="{color: color,height: x_height?(x_height+'px'):'',lineHeight: x_height?(x_height+'px'):'',top: x_statusHeight?(x_statusHeight+'px'):''}"> :style="{color: color,height: x_height?(x_height+'px'):'',lineHeight: x_height?(x_height+'px'):'',top: x_statusHeight?(x_statusHeight+'px'):'', width: middleLayout=='left'?'auto':'', padding: middleLayout=='left'?'0 10rpx':''}">
<slot name="left"> <slot name="left">
<!-- <i v-if="back" class="niu-navbar__icon iconfont icon-back_light"></i> --> <!-- <i v-if="back" class="niu-navbar__icon iconfont icon-back_light"></i> -->
<image v-if="!firstPage&&back" class="niu-navbar__icon" <image v-if="!firstPage&&back" class="niu-navbar__icon"

16
uni_modules/niu-ui/components/niu-page/niu-page.vue

@ -1,5 +1,5 @@
<template> <template>
<view :class="[className, Tab?'tabpage':'page']" :style="inStyle"> <view :class="[Tab?'tabpage':'page']">
<slot></slot> <slot></slot>
</view> </view>
</template> </template>
@ -11,14 +11,6 @@
Tab: { Tab: {
type: Boolean, type: Boolean,
default: false default: false
},
className: {
type: String || Array,
default: ''
},
inStyle:{
type: String || Object,
default: ''
} }
}, },
data() { data() {
@ -33,12 +25,8 @@
this.curPage = pages[len - 1]; this.curPage = pages[len - 1];
this._curDeep = len; this._curDeep = len;
}, },
methods:{ methods: {
} }
} }
</script> </script>
<style lang="scss" scoped>
</style>

9
uni_modules/niu-ui/components/niu-tabs/niu-tabs.vue

@ -12,8 +12,9 @@
<!-- 循环中使用slot会报警告暂时去除未找到处理办法 --> <!-- 循环中使用slot会报警告暂时去除未找到处理办法 -->
<!-- <slot :data="item" :pData="pData" :index="index"> --> <!-- <slot :data="item" :pData="pData" :index="index"> -->
<text>{{item[akey]}}</text> <text>{{item[akey]}}</text>
<view v-if="value==index && activeImage" class="niu-x-tabs__bg"> <!-- 必须两个if不然有时app上出错了 -->
<image class="image" :src="activeImage" mode="widthFix"></image> <view v-if="value==index && !!activeImage" class="niu-x-tabs__bg">
<image v-if="value==index && !!activeImage" class="image" :src="activeImage" mode="widthFix"></image>
</view> </view>
<!-- </slot> --> <!-- </slot> -->
</view> </view>
@ -26,7 +27,7 @@
:item="list[value]" :item="list[value]"
:props="{normalColor, activeColor}" :props="{normalColor, activeColor}"
> >
<view v-if="bar&&value<list.length" class="niu-x-tabs__bar" :class="{capsule}" :style="[{left:barLeft + 'px',width:barWidth + 'px',backgroundColor: barColor},, anim?{transition: 'left .3s ease, width .3s ease'}:{}]"></view> <view v-if="bar&&value<list.length" class="niu-x-tabs__bar" :class="{capsule}" :style="[{left:barLeft + 'px',width:barWidth + 'px',backgroundColor: barColor}, anim?{transition: 'left .3s ease, width .3s ease'}:{}]"></view>
</slot> </slot>
</view> </view>
</view> </view>
@ -201,7 +202,9 @@
if (isClick && this.value == index) return if (isClick && this.value == index) return
if (this.allLeft.length) { if (this.allLeft.length) {
this.$emit("change", index) this.$emit("change", index)
console.log(this.allLeft, this.barPer);
this.barWidth = this.allLeft[index][1] * this.barPer this.barWidth = this.allLeft[index][1] * this.barPer
console.log(this.barWidth);
this.barLeft = this.allLeft[index][0] + (this.allLeft[index][1] - this.barWidth)/2 this.barLeft = this.allLeft[index][0] + (this.allLeft[index][1] - this.barWidth)/2
this.left = (this.allLeft[index][0] - this.allLeft[index][1] * 2) this.left = (this.allLeft[index][0] - this.allLeft[index][1] * 2)
} }

8
uni_modules/niu-ui/components/niu-ui/niu-ui.vue

@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>

7
uni_modules/niu-ui/index.js

@ -6,11 +6,14 @@ export {
util util
} }
export default { export default {
install(Vue) { install(Vue, options = {}) {
const data = Vue.observable({ const data = Vue.observable({
data: {}, data: {},
util: util, util: util,
toast: toast toast: toast,
config: {
mainColor: "#39b54a"
},
}) })
Vue.mixin({ Vue.mixin({
computed: { computed: {

12
uni_modules/niu-ui/package.json

@ -1,7 +1,7 @@
{ {
"id": "niu-ui", "id": "niu-ui",
"displayName": "niu-ui", "displayName": "niu-ui",
"version": "1.0.0", "version": "0.0.1.alpha.1",
"description": "niu-ui", "description": "niu-ui",
"keywords": [ "keywords": [
"niu-ui" "niu-ui"
@ -28,9 +28,9 @@
"qq": "" "qq": ""
}, },
"declaration": { "declaration": {
"ads": "", "ads": "",
"data": "", "data": "插件不采集任何数据",
"permissions": "" "permissions": ""
}, },
"npmurl": "" "npmurl": ""
}, },
@ -39,8 +39,8 @@
"encrypt": [], "encrypt": [],
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "u", "tcb": "y",
"aliyun": "u" "aliyun": "y"
}, },
"client": { "client": {
"App": { "App": {

7
uni_modules/niu-ui/readme.md

@ -1 +1,8 @@
# niu-ui # niu-ui
第一个版本,目前仅供个人使用
```
import niuUI, {toast} from '@/uni_modules/niu-ui'
Vue.use(niuUI)
```
Loading…
Cancel
Save