mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
Merge branch 'master' into loading
This commit is contained in:
commit
8b6c2d4351
35
README.md
35
README.md
@ -0,0 +1,35 @@
|
|||||||
|
## 下载项目
|
||||||
|
```bash
|
||||||
|
git@gitlab.qima-inc.com:fe/oxygen.git
|
||||||
|
cd oxygen
|
||||||
|
```
|
||||||
|
|
||||||
|
## 安装组件依赖库
|
||||||
|
```bash
|
||||||
|
ynpm i
|
||||||
|
```
|
||||||
|
|
||||||
|
## 新建组件(以waterfall为例)
|
||||||
|
新建一个Vue组件,比如 waterfall
|
||||||
|
```bash
|
||||||
|
make init waterfall
|
||||||
|
```
|
||||||
|
就可以在 packages目录 里面看到waterfall初始化的组件代码了。记得更新package.json和README.md里的组件描述信息
|
||||||
|
|
||||||
|
## 示例预览(以waterfall为例)
|
||||||
|
在 docs/nav.config.json 文件里合适的地方写入组件声明,根据组件类型(JS组件,CSS组件,Form等)进行区分
|
||||||
|
在 docs/examples 目录里新建 同名的md文件,如 waterfall.md
|
||||||
|
在项目的根目录下执行以下命令,启动server
|
||||||
|
```
|
||||||
|
make dev
|
||||||
|
```
|
||||||
|
浏览器访问 http://localhost:8080/#/ 就可以看到所有组件的示例了
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -66,7 +66,7 @@
|
|||||||
|
|
||||||
### 自定义按钮标签
|
### 自定义按钮标签
|
||||||
|
|
||||||
:::demo 有时按钮需要是一个a标签
|
:::demo 按钮默认是button标签,可以使用tag属性修改为一个a标签
|
||||||
```html
|
```html
|
||||||
<div class="z-button-group">
|
<div class="z-button-group">
|
||||||
<div class="z-button-1-1">
|
<div class="z-button-1-1">
|
||||||
|
@ -42,6 +42,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
handleClick() {
|
||||||
|
this.$emit('click');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
render(h) {
|
render(h) {
|
||||||
let { type, nativeType, size, disabled, loading, block } = this;
|
let { type, nativeType, size, disabled, loading, block } = this;
|
||||||
let Tag = this.tag;
|
let Tag = this.tag;
|
||||||
@ -60,6 +66,7 @@ export default {
|
|||||||
'is-block': block
|
'is-block': block
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
|
onClick={this.handleClick}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
loading ? <i class="z-icon-loading"></i> : null
|
loading ? <i class="z-icon-loading"></i> : null
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<a class="z-cell" :href="url" @click="handleClick">
|
<a class="z-cell" :href="url" @click="handleClick">
|
||||||
<div class="z-cell-title">
|
<div class="z-cell__title">
|
||||||
<slot name="icon">
|
<slot name="icon">
|
||||||
<i v-if="icon" class="zui-icon" :class="'zui-icon-' + icon"></i>
|
<i v-if="icon" class="zui-icon" :class="'zui-icon-' + icon"></i>
|
||||||
</slot>
|
</slot>
|
||||||
<slot name="title">
|
<slot name="title">
|
||||||
<span class="z-cell-text" v-text="title"></span>
|
<span class="z-cell-text" v-text="title"></span>
|
||||||
<span class="z-cell-label" v-if="label" v-text="label"></span>
|
<span class="z-cell__abel" v-if="label" v-text="label"></span>
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
<div class="z-cell-value" :class="{ 'is-link' : isLink }">
|
<div class="z-cell__value" :class="{ 'is-link' : isLink }">
|
||||||
<slot>
|
<slot>
|
||||||
<span v-text="value"></span>
|
<span v-text="value"></span>
|
||||||
</slot>
|
</slot>
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
<transition name="dialog-bounce">
|
<transition name="dialog-bounce">
|
||||||
<div class="z-dialog-wrapper">
|
<div class="z-dialog-wrapper">
|
||||||
<div class="z-dialog" v-show="value">
|
<div class="z-dialog" v-show="value">
|
||||||
<div class="z-dialog-header" v-if="title">
|
<div class="z-dialog__header" v-if="title">
|
||||||
<div class="z-dialog-title" v-text="title"></div>
|
<div class="z-dialog__title" v-text="title"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="z-dialog-content" v-if="message">
|
<div class="z-dialog__content" v-if="message">
|
||||||
<div class="z-dialog-message" v-html="message"></div>
|
<div class="z-dialog__message" v-html="message"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="z-dialog-footer" :class="{ 'is-twobtn': showCancelButton && showConfirmButton }">
|
<div class="z-dialog__footer" :class="{ 'is-twobtn': showCancelButton && showConfirmButton }">
|
||||||
<button class="z-dialog-btn z-dialog-cancel" v-show="showCancelButton" @click="handleAction('cancel')">{{ cancelButtonText }}</button>
|
<button class="z-dialog__btn z-dialog__cancel" v-show="showCancelButton" @click="handleAction('cancel')">{{ cancelButtonText }}</button>
|
||||||
<button class="z-dialog-btn z-dialog-confirm" v-show="showConfirmButton" @click="handleAction('confirm')">{{ confirmButtonText }}</button>
|
<button class="z-dialog__btn z-dialog__confirm" v-show="showConfirmButton" @click="handleAction('confirm')">{{ confirmButtonText }}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
}">
|
}">
|
||||||
<textarea
|
<textarea
|
||||||
v-if="type === 'textarea'"
|
v-if="type === 'textarea'"
|
||||||
class="z-field-control"
|
class="z-field__control"
|
||||||
v-model="currentValue"
|
v-model="currentValue"
|
||||||
@change="$emit('change', currentValue)"
|
@change="$emit('change', currentValue)"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
@ -18,7 +18,7 @@
|
|||||||
</textarea>
|
</textarea>
|
||||||
<input
|
<input
|
||||||
v-else
|
v-else
|
||||||
class="z-field-control"
|
class="z-field__control"
|
||||||
:value="currentValue"
|
:value="currentValue"
|
||||||
@change="$emit('change', currentValue)"
|
@change="$emit('change', currentValue)"
|
||||||
@input="handleInput"
|
@input="handleInput"
|
||||||
|
@ -154,7 +154,9 @@ export default {
|
|||||||
var el = this.$refs.wrapper;
|
var el = this.$refs.wrapper;
|
||||||
var dragState = {};
|
var dragState = {};
|
||||||
|
|
||||||
var velocityTranslate, prevTranslate, pickerItems;
|
var velocityTranslate;
|
||||||
|
var prevTranslate;
|
||||||
|
var pickerItems; // eslint-disable-line
|
||||||
|
|
||||||
draggable(el, {
|
draggable(el, {
|
||||||
start: (event) => {
|
start: (event) => {
|
||||||
@ -166,7 +168,7 @@ export default {
|
|||||||
startTop: event.pageY,
|
startTop: event.pageY,
|
||||||
startTranslateTop: translateUtil.getElementTranslate(el).top
|
startTranslateTop: translateUtil.getElementTranslate(el).top
|
||||||
};
|
};
|
||||||
pickerItems = el.querySelectorAll('.z-picker-item');
|
pickerItems = el.querySelectorAll('.z-picker-item'); // eslint-disable-line
|
||||||
},
|
},
|
||||||
|
|
||||||
drag: (event) => {
|
drag: (event) => {
|
||||||
|
@ -98,7 +98,6 @@ export default {
|
|||||||
*/
|
*/
|
||||||
getColumnValue(index) {
|
getColumnValue(index) {
|
||||||
let column = this.getColumn(index);
|
let column = this.getColumn(index);
|
||||||
console.log(column)
|
|
||||||
return column && column.values[column.valueIndex];
|
return column && column.values[column.valueIndex];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -63,6 +63,9 @@
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
mini图标默认宽度50px,文字不能超过4个
|
||||||
|
*/
|
||||||
@m mini {
|
@m mini {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 50px;
|
width: 50px;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
@import "./mixins/border_retina.pcss";
|
@import "./mixins/border_retina.pcss";
|
||||||
|
|
||||||
@component-namespace z {
|
@component-namespace z {
|
||||||
@component cell-group {
|
@b cell-group {
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
@ -11,7 +11,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@component cell {
|
@b cell {
|
||||||
display: block;
|
display: block;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -33,19 +33,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@descendent title {
|
@empty-cells: show title {
|
||||||
float: left;
|
float: left;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@descendent label {
|
@e label {
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
@descendent value {
|
@e value {
|
||||||
float: right;
|
float: right;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
@import "./mixins/border_retina.pcss";
|
@import "./mixins/border_retina.pcss";
|
||||||
|
|
||||||
@component-namespace z {
|
@component-namespace z {
|
||||||
@component dialog-wrapper {
|
@b dialog-wrapper {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
||||||
@component dialog {
|
@b dialog {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
@ -18,11 +18,11 @@
|
|||||||
backface-visibility: hidden;
|
backface-visibility: hidden;
|
||||||
transition: .2s;
|
transition: .2s;
|
||||||
|
|
||||||
@descendent header {
|
@e header {
|
||||||
padding: 15px 0 0;
|
padding: 15px 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@descendent content {
|
@e content {
|
||||||
padding: 15px 20px;
|
padding: 15px 20px;
|
||||||
min-height: 36px;
|
min-height: 36px;
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -32,7 +32,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@descendent title {
|
@e title {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
@ -40,31 +40,31 @@
|
|||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
@descendent message {
|
@e message {
|
||||||
color: #999;
|
color: #999;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@descendent footer {
|
@e footer {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
|
||||||
|
|
||||||
.is-twobtn {
|
@when twobtn {
|
||||||
.z-dialog-btn {
|
.z-dialog__btn {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.z-dialog-cancel {
|
.z-dialog__cancel {
|
||||||
&::after {
|
&::after {
|
||||||
@mixin border-retina (right);
|
@mixin border-retina (right);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@descendent btn {
|
@e btn {
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
border: 0;
|
border: 0;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@ -74,11 +74,11 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
@descendent cancel {
|
@e cancel {
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
@descendent confirm {
|
@e confirm {
|
||||||
color: #00C000;
|
color: #00C000;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
@ -2,46 +2,46 @@
|
|||||||
@import "./mixins/border_retina.pcss";
|
@import "./mixins/border_retina.pcss";
|
||||||
|
|
||||||
@component-namespace z {
|
@component-namespace z {
|
||||||
@component field {
|
@b field {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
@when textarea {
|
@when textarea {
|
||||||
.z-field-control {
|
.z-field__control {
|
||||||
min-height: 60px;
|
min-height: 60px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@when nolabel {
|
@when nolabel {
|
||||||
.z-cell-title {
|
.z-cell__title {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.z-cell-value {
|
.z-cell__value {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.z-cell-title,
|
.z-cell__title,
|
||||||
.z-cell-value {
|
.z-cell__value {
|
||||||
float: none;
|
float: none;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.z-cell-title {
|
.z-cell__title {
|
||||||
width: 90px;
|
width: 90px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 10px;
|
top: 10px;
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.z-cell-value {
|
.z-cell__value {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-left: 90px;
|
padding-left: 90px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.z-field-control {
|
@e control {
|
||||||
border: 0;
|
border: 0;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@component-namespace z {
|
@component-namespace z {
|
||||||
@component popup {
|
@b popup {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
@ -17,7 +17,7 @@
|
|||||||
backface-visibility: hidden;
|
backface-visibility: hidden;
|
||||||
transition: .2s ease-out;
|
transition: .2s ease-out;
|
||||||
|
|
||||||
@modifier top {
|
@m top {
|
||||||
top: 0;
|
top: 0;
|
||||||
right: auto;
|
right: auto;
|
||||||
bottom: auto;
|
bottom: auto;
|
||||||
@ -25,7 +25,7 @@
|
|||||||
transform: translate3d(-50%, 0, 0);
|
transform: translate3d(-50%, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@modifier right {
|
@m right {
|
||||||
top: 50%;
|
top: 50%;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: auto;
|
bottom: auto;
|
||||||
@ -33,7 +33,7 @@
|
|||||||
transform: translate3d(0, -50%, 0);
|
transform: translate3d(0, -50%, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@modifier bottom {
|
@m bottom {
|
||||||
top: auto;
|
top: auto;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
right: auto;
|
right: auto;
|
||||||
@ -41,7 +41,7 @@
|
|||||||
transform: translate3d(-50%, 0, 0);
|
transform: translate3d(-50%, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@modifier left {
|
@m left {
|
||||||
top: 50%;
|
top: 50%;
|
||||||
right: auto;
|
right: auto;
|
||||||
bottom: auto;
|
bottom: auto;
|
||||||
|
@ -7,7 +7,7 @@ if (!Vue.prototype.$isServer) {
|
|||||||
var engine;
|
var engine;
|
||||||
var translate3d = false;
|
var translate3d = false;
|
||||||
|
|
||||||
if (window.opera && Object.prototype.toString.call(opera) === '[object Opera]') {
|
if (window.opera && Object.prototype.toString.call(window.opera) === '[object Opera]') {
|
||||||
engine = 'presto';
|
engine = 'presto';
|
||||||
} else if ('MozAppearance' in docStyle) {
|
} else if ('MozAppearance' in docStyle) {
|
||||||
engine = 'gecko';
|
engine = 'gecko';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user