mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
step component
This commit is contained in:
parent
b9716a4dab
commit
6f2b44bb4d
@ -16,9 +16,9 @@ const install = function(Vue) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// auto install
|
// auto install
|
||||||
if (typeof window !== 'undefined' && window.Vue) {
|
// if (typeof window !== 'undefined' && window.Vue) {
|
||||||
install(window.Vue);
|
// install(window.Vue);
|
||||||
}
|
// }
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
install,
|
install,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
## Steps 步骤条
|
## Steps 步骤条
|
||||||
|
|
||||||
|
### 基础用法
|
||||||
|
|
||||||
|
13
docs/examples/steps.vue
Normal file
13
docs/examples/steps.vue
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
<div class="page-steps">
|
||||||
|
<h1 class="page-title">Steps</h1>
|
||||||
|
|
||||||
|
<h2 class="page-sub-title">基础用法</h2>
|
||||||
|
<zan-steps icon="topay">
|
||||||
|
</zan-steps>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
</script>
|
@ -11,7 +11,7 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"bootstrap": "npm i --registry=http://registry.npm.qima-inc.com",
|
"bootstrap": "npm i --registry=http://registry.npm.qima-inc.com",
|
||||||
"dev": "npm run build:file && webpack-dev-server --port 8282 --inline --hot --config build/webpack.config.js",
|
"dev": "npm run build:file && webpack-dev-server --inline --hot --config build/webpack.config.js",
|
||||||
"build:file": "node build/bin/build-entry.js",
|
"build:file": "node build/bin/build-entry.js",
|
||||||
"build:utils": "cross-env BABEL_ENV=utils babel src --out-dir lib --ignore src/index.js",
|
"build:utils": "cross-env BABEL_ENV=utils babel src --out-dir lib --ignore src/index.js",
|
||||||
"build:zanui-css": "gulp build --gulpfile packages/zanui-css/gulpfile.js && cp-cli packages/zanui-css/lib lib/zanui-css",
|
"build:zanui-css": "gulp build --gulpfile packages/zanui-css/gulpfile.js && cp-cli packages/zanui-css/lib lib/zanui-css",
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'zan-step'
|
name: 'zan-step',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
title: String
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="zan-steps">
|
<div class="zan-steps">
|
||||||
<div class="zan-steps__desc"></div>
|
<div class="zan-steps__desc" v-if="icon">
|
||||||
|
<i class="zan-icon" :class="computedIconClass"></i>
|
||||||
|
</div>
|
||||||
<div class="zan-steps__items">
|
<div class="zan-steps__items">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
@ -8,7 +10,25 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'zan-steps'
|
name: 'zan-steps',
|
||||||
};
|
|
||||||
|
props: {
|
||||||
|
active: Number,
|
||||||
|
icon: String,
|
||||||
|
iconClass: String,
|
||||||
|
title: String,
|
||||||
|
description: String
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
computedIconClass() {
|
||||||
|
let iconName = `zan-icon-${this.icon}`;
|
||||||
|
let result = (iconClass && iconClass.split(' ')) || [];
|
||||||
|
result.push(iconName);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
@import "./common/var.css";
|
||||||
|
|
||||||
@component-namespace zan {
|
@component-namespace zan {
|
||||||
@b steps {
|
@b steps {
|
||||||
color: red;
|
padding: 15px 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ const install = function(Vue) {
|
|||||||
Vue.component(Step.name, Step);
|
Vue.component(Step.name, Step);
|
||||||
};
|
};
|
||||||
|
|
||||||
// auto install
|
auto install
|
||||||
if (typeof window !== 'undefined' && window.Vue) {
|
if (typeof window !== 'undefined' && window.Vue) {
|
||||||
install(window.Vue);
|
install(window.Vue);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user