mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-23 18:00:27 +08:00
Merge branch 'dev'
This commit is contained in:
commit
495e1ac65b
@ -46,7 +46,6 @@ module.exports = {
|
|||||||
'eol-last': 2,
|
'eol-last': 2,
|
||||||
'eqeqeq': [2, 'allow-null'],
|
'eqeqeq': [2, 'allow-null'],
|
||||||
'generator-star-spacing': [2, { 'before': true, 'after': true }],
|
'generator-star-spacing': [2, { 'before': true, 'after': true }],
|
||||||
'handle-callback-err': [2, '^(err|error)$' ],
|
|
||||||
'indent': [2, 2, { 'SwitchCase': 1 }],
|
'indent': [2, 2, { 'SwitchCase': 1 }],
|
||||||
'jsx-quotes': [2, 'prefer-double'],
|
'jsx-quotes': [2, 'prefer-double'],
|
||||||
'key-spacing': [2, { 'beforeColon': false, 'afterColon': true }],
|
'key-spacing': [2, { 'beforeColon': false, 'afterColon': true }],
|
||||||
|
2
.github/CONTRIBUTING.zh-CN.md
vendored
2
.github/CONTRIBUTING.zh-CN.md
vendored
@ -62,7 +62,7 @@ vant
|
|||||||
|
|
||||||
- 添加测试代码
|
- 添加测试代码
|
||||||
|
|
||||||
需要在 `test/unit/specs` 目录下增加对应组件的测试文件,以 .spec.js 结尾,如:`button.spec.js`。测试框架使用了 karma + mocha + sinon + chai,vue 相关的操作使用了 [avoriaz](https://github.com/eddyerburgh/avoriaz)
|
需要在 `test/specs` 目录下增加对应组件的测试文件,以 .spec.js 结尾,如:`button.spec.js`。测试框架使用了 karma + mocha + sinon + chai,vue 相关的操作使用了 [avoriaz](https://github.com/eddyerburgh/avoriaz)
|
||||||
|
|
||||||
|
|
||||||
## 组件文档如何编写
|
## 组件文档如何编写
|
||||||
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -5,13 +5,9 @@
|
|||||||
.vscode
|
.vscode
|
||||||
packages/**/lib
|
packages/**/lib
|
||||||
lib/
|
lib/
|
||||||
lib/*
|
|
||||||
!lib/index.js
|
|
||||||
!lib/style.css
|
|
||||||
node_modules
|
node_modules
|
||||||
example/dist
|
example/dist
|
||||||
/docs/dist
|
/docs/dist
|
||||||
test/unit/coverage
|
test/coverage
|
||||||
packages/vant-css/build
|
packages/vant-css/build
|
||||||
packages/vant-css/icons
|
packages/vant-css/icons
|
||||||
docs/examples-dist
|
|
||||||
|
@ -16,4 +16,4 @@ script:
|
|||||||
npm run lint && npm run test
|
npm run lint && npm run test
|
||||||
after_success:
|
after_success:
|
||||||
- |
|
- |
|
||||||
cat ./test/unit/coverage/lcov.info | ./node_modules/.bin/codecov
|
cat ./test/coverage/lcov.info | ./node_modules/.bin/codecov
|
||||||
|
@ -62,7 +62,7 @@ import { Button } from 'vant';
|
|||||||
#### 2. Manually import
|
#### 2. Manually import
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { Button } from 'vant/lib/button';
|
import Button from 'vant/lib/button';
|
||||||
import 'vant/lib/vant-css/base.css';
|
import 'vant/lib/vant-css/base.css';
|
||||||
import 'vant/lib/vant-css/button.css';
|
import 'vant/lib/vant-css/button.css';
|
||||||
```
|
```
|
||||||
|
@ -59,7 +59,7 @@ import { Button } from 'vant';
|
|||||||
#### 方式二. 按需引入组件
|
#### 方式二. 按需引入组件
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { Button } from 'vant/lib/button';
|
import Button from 'vant/lib/button';
|
||||||
import 'vant/lib/vant-css/base.css';
|
import 'vant/lib/vant-css/base.css';
|
||||||
import 'vant/lib/vant-css/button.css';
|
import 'vant/lib/vant-css/button.css';
|
||||||
```
|
```
|
||||||
|
@ -33,13 +33,11 @@ function compile(dir) {
|
|||||||
// 移除 vant-css
|
// 移除 vant-css
|
||||||
if (file.indexOf('vant-css') !== -1) {
|
if (file.indexOf('vant-css') !== -1) {
|
||||||
fs.removeSync(absolutePath);
|
fs.removeSync(absolutePath);
|
||||||
}
|
|
||||||
// 遍历文件夹
|
// 遍历文件夹
|
||||||
else if (isDir(absolutePath)) {
|
} else if (isDir(absolutePath)) {
|
||||||
return compile(absolutePath);
|
return compile(absolutePath);
|
||||||
}
|
|
||||||
// 编译 .vue 文件
|
// 编译 .vue 文件
|
||||||
else if (/\.vue$/.test(file)) {
|
} else if (/\.vue$/.test(file)) {
|
||||||
const source = fs.readFileSync(absolutePath, 'utf-8');
|
const source = fs.readFileSync(absolutePath, 'utf-8');
|
||||||
fs.removeSync(absolutePath);
|
fs.removeSync(absolutePath);
|
||||||
|
|
||||||
@ -49,9 +47,13 @@ function compile(dir) {
|
|||||||
|
|
||||||
fs.outputFileSync(output, compiler(source, compilerOption).js);
|
fs.outputFileSync(output, compiler(source, compilerOption).js);
|
||||||
} else if (/\.js$/.test(file)) {
|
} else if (/\.js$/.test(file)) {
|
||||||
babel.transformFile(absolutePath, compilerOption.babel, (err, { code }) => {
|
babel.transformFile(
|
||||||
|
absolutePath,
|
||||||
|
compilerOption.babel,
|
||||||
|
(err, { code }) => {
|
||||||
fs.outputFileSync(absolutePath, code);
|
fs.outputFileSync(absolutePath, code);
|
||||||
});
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ log('Finished', 'build:style-entries');
|
|||||||
function log(status, action, breakLine) {
|
function log(status, action, breakLine) {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const clock = `${breakLine ? '\n' : ''}[${padZero(now.getHours())}:${padZero(now.getMinutes())}:${padZero(now.getSeconds())}]`;
|
const clock = `${breakLine ? '\n' : ''}[${padZero(now.getHours())}:${padZero(now.getMinutes())}:${padZero(now.getSeconds())}]`;
|
||||||
console.log(`${chalk.gray(clock)} ${status} '${action ? chalk.cyan.bold(action ) : ''}'`);
|
console.log(`${chalk.gray(clock)} ${status} '${action ? chalk.cyan.bold(action) : ''}'`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function padZero(num) {
|
function padZero(num) {
|
||||||
|
@ -6,7 +6,6 @@ const fs = require('fs-extra');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const components = require('./get-components')();
|
const components = require('./get-components')();
|
||||||
const dependencyTree = require('dependency-tree');
|
const dependencyTree = require('dependency-tree');
|
||||||
|
|
||||||
const SEP = path.sep;
|
const SEP = path.sep;
|
||||||
|
|
||||||
components.forEach(componentName => {
|
components.forEach(componentName => {
|
||||||
|
@ -4,5 +4,5 @@ const path = require('path');
|
|||||||
module.exports = function() {
|
module.exports = function() {
|
||||||
const dirs = fs.readdirSync(path.resolve(__dirname, '../../packages'));
|
const dirs = fs.readdirSync(path.resolve(__dirname, '../../packages'));
|
||||||
const excludes = ['index.js', 'vant-css', 'mixins', 'utils', '.DS_Store'];
|
const excludes = ['index.js', 'vant-css', 'mixins', 'utils', '.DS_Store'];
|
||||||
return dirs.filter(dirName => excludes.indexOf(dirName) === -1)
|
return dirs.filter(dirName => excludes.indexOf(dirName) === -1);
|
||||||
}
|
};
|
||||||
|
@ -1,50 +1,29 @@
|
|||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const config = require('./webpack.config.dev.js');
|
const config = require('./webpack.config.dev.js');
|
||||||
const isMinify = process.argv.indexOf('-p') !== -1;
|
const isMinify = process.argv.indexOf('-p') !== -1;
|
||||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
|
||||||
|
|
||||||
config.entry = {
|
module.exports = Object.assign({}, config, {
|
||||||
|
entry: {
|
||||||
'vant': './packages/index.js'
|
'vant': './packages/index.js'
|
||||||
};
|
},
|
||||||
|
output: {
|
||||||
config.output = {
|
|
||||||
filename: isMinify ? './lib/[name].min.js' : './lib/[name].js',
|
filename: isMinify ? './lib/[name].min.js' : './lib/[name].js',
|
||||||
library: 'vant',
|
library: 'vant',
|
||||||
libraryTarget: 'umd',
|
libraryTarget: 'umd',
|
||||||
umdNamedDefine: true
|
umdNamedDefine: true
|
||||||
};
|
},
|
||||||
|
externals: {
|
||||||
config.externals = {
|
|
||||||
vue: {
|
vue: {
|
||||||
root: 'Vue',
|
root: 'Vue',
|
||||||
commonjs: 'vue',
|
commonjs: 'vue',
|
||||||
commonjs2: 'vue',
|
commonjs2: 'vue',
|
||||||
amd: 'vue'
|
amd: 'vue'
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
plugins: [
|
||||||
config.plugins = [
|
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env.NODE_ENV': '"production"'
|
'process.env.NODE_ENV': '"production"'
|
||||||
}),
|
}),
|
||||||
new webpack.LoaderOptionsPlugin({
|
|
||||||
minimize: true,
|
|
||||||
debug: false,
|
|
||||||
options: {
|
|
||||||
vue: {
|
|
||||||
autoprefixer: false,
|
|
||||||
preserveWhitespace: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
new webpack.optimize.ModuleConcatenationPlugin()
|
new webpack.optimize.ModuleConcatenationPlugin()
|
||||||
];
|
]
|
||||||
|
});
|
||||||
// analyze bundle size if need
|
|
||||||
// if (isMinify) {
|
|
||||||
// config.plugins.push(new BundleAnalyzerPlugin());
|
|
||||||
// }
|
|
||||||
|
|
||||||
delete config.devtool;
|
|
||||||
|
|
||||||
module.exports = config;
|
|
||||||
|
@ -14,9 +14,8 @@ const cache = {
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: {
|
entry: {
|
||||||
vendor: ['packages'],
|
|
||||||
'vant-docs': './docs/src/index.js',
|
'vant-docs': './docs/src/index.js',
|
||||||
'vant-examples': './docs/src/examples.js'
|
'vant-mobile': './docs/src/mobile.js'
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: path.join(__dirname, '../docs/dist'),
|
path: path.join(__dirname, '../docs/dist'),
|
||||||
@ -90,7 +89,6 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
devtool: 'source-map',
|
|
||||||
plugins: [
|
plugins: [
|
||||||
new ProgressBarPlugin(),
|
new ProgressBarPlugin(),
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
@ -100,7 +98,7 @@ module.exports = {
|
|||||||
inject: true
|
inject: true
|
||||||
}),
|
}),
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
chunks: ['vendor', 'vant-examples'],
|
chunks: ['vendor', 'vant-mobile'],
|
||||||
template: 'docs/src/index.tpl',
|
template: 'docs/src/index.tpl',
|
||||||
filename: 'examples.html',
|
filename: 'examples.html',
|
||||||
inject: true
|
inject: true
|
||||||
|
@ -6,27 +6,17 @@ const devConfig = require('./webpack.config.dev.js');
|
|||||||
module.exports = merge(devConfig, {
|
module.exports = merge(devConfig, {
|
||||||
output: {
|
output: {
|
||||||
path: path.join(__dirname, '../docs/dist'),
|
path: path.join(__dirname, '../docs/dist'),
|
||||||
publicPath: 'https://b.yzcdn.cn/zanui/vant/',
|
publicPath: 'https://img.yzcdn.cn/zanui/vant/',
|
||||||
filename: '[name].[hash:8].js',
|
filename: '[name].[hash:8].js',
|
||||||
umdNamedDefine: true,
|
umdNamedDefine: true,
|
||||||
chunkFilename: 'async_[name].[chunkhash:8].js'
|
chunkFilename: 'async_[name].[chunkhash:8].js'
|
||||||
},
|
},
|
||||||
devtool: false,
|
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': {
|
'process.env': {
|
||||||
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
|
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
new webpack.optimize.UglifyJsPlugin({
|
new webpack.optimize.UglifyJsPlugin()
|
||||||
compress: {
|
|
||||||
warnings: false,
|
|
||||||
drop_console: true
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
comments: false
|
|
||||||
},
|
|
||||||
sourceMap: false
|
|
||||||
})
|
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
@ -26,6 +26,7 @@ export default {
|
|||||||
'address-list': asyncWrapper(r => require.ensure([], () => r(componentWrapper(require('./views/address-list'), 'address-list')), 'address-list')),
|
'address-list': asyncWrapper(r => require.ensure([], () => r(componentWrapper(require('./views/address-list'), 'address-list')), 'address-list')),
|
||||||
'area': asyncWrapper(r => require.ensure([], () => r(componentWrapper(require('./views/area'), 'area')), 'area')),
|
'area': asyncWrapper(r => require.ensure([], () => r(componentWrapper(require('./views/area'), 'area')), 'area')),
|
||||||
'badge': asyncWrapper(r => require.ensure([], () => r(componentWrapper(require('./views/badge'), 'badge')), 'badge')),
|
'badge': asyncWrapper(r => require.ensure([], () => r(componentWrapper(require('./views/badge'), 'badge')), 'badge')),
|
||||||
|
'built-in-style': asyncWrapper(r => require.ensure([], () => r(componentWrapper(require('./views/built-in-style'), 'built-in-style')), 'built-in-style')),
|
||||||
'button': asyncWrapper(r => require.ensure([], () => r(componentWrapper(require('./views/button'), 'button')), 'button')),
|
'button': asyncWrapper(r => require.ensure([], () => r(componentWrapper(require('./views/button'), 'button')), 'button')),
|
||||||
'card': asyncWrapper(r => require.ensure([], () => r(componentWrapper(require('./views/card'), 'card')), 'card')),
|
'card': asyncWrapper(r => require.ensure([], () => r(componentWrapper(require('./views/card'), 'card')), 'card')),
|
||||||
'cell-swipe': asyncWrapper(r => require.ensure([], () => r(componentWrapper(require('./views/cell-swipe'), 'cell-swipe')), 'cell-swipe')),
|
'cell-swipe': asyncWrapper(r => require.ensure([], () => r(componentWrapper(require('./views/cell-swipe'), 'cell-swipe')), 'cell-swipe')),
|
||||||
|
85
docs/demos/views/built-in-style.vue
Normal file
85
docs/demos/views/built-in-style.vue
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
<template>
|
||||||
|
<demo-section>
|
||||||
|
<demo-block :title="$t('ellipsis')">
|
||||||
|
<div class="van-ellipsis">{{ $t('text') }}</div>
|
||||||
|
</demo-block>
|
||||||
|
|
||||||
|
<demo-block :title="$t('hairline')">
|
||||||
|
<div class="van-hairline--top" />
|
||||||
|
</demo-block>
|
||||||
|
|
||||||
|
<demo-block :title="$t('animation')">
|
||||||
|
<van-switch-cell v-model="show" :title="$t('toggle')" :border="false" />
|
||||||
|
<van-row>
|
||||||
|
<transition name="van-fade">
|
||||||
|
<van-col span="8" v-show="show">Fade</van-col>
|
||||||
|
</transition>
|
||||||
|
|
||||||
|
<transition name="van-slide-bottom">
|
||||||
|
<van-col span="8" v-show="show">Slide Bottom</van-col>
|
||||||
|
</transition>
|
||||||
|
</van-row>
|
||||||
|
</demo-block>
|
||||||
|
</demo-section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
i18n: {
|
||||||
|
'zh-CN': {
|
||||||
|
hairline: '1px 边框',
|
||||||
|
ellipsis: '文字省略',
|
||||||
|
animation: '动画',
|
||||||
|
toggle: '切换动画',
|
||||||
|
text: '这是一段宽度限制 250px 的文字,后面的内容会省略'
|
||||||
|
},
|
||||||
|
'en-US': {
|
||||||
|
hairline: 'Hairline',
|
||||||
|
ellipsis: 'Text Ellipsis',
|
||||||
|
animation: 'Animation',
|
||||||
|
toggle: 'Switch animation',
|
||||||
|
text: 'This is a paragraph of 250px width limit, the back will be omitted.'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
show: true
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="postcss">
|
||||||
|
.demo-built-in-style {
|
||||||
|
.van-ellipsis {
|
||||||
|
font-size: 13px;
|
||||||
|
margin-left: 15px;
|
||||||
|
max-width: 250px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-hairline--top {
|
||||||
|
height: 30px;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
top: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-col {
|
||||||
|
height: 50px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 14px;
|
||||||
|
border-radius: 3px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 50px;
|
||||||
|
margin-left: 15px;
|
||||||
|
background-color: #39a9ed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.van-switch-cell {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -9,6 +9,11 @@
|
|||||||
<van-checkbox :value="true" disabled>{{ $t('checkbox') }} 2</van-checkbox>
|
<van-checkbox :value="true" disabled>{{ $t('checkbox') }} 2</van-checkbox>
|
||||||
</demo-block>
|
</demo-block>
|
||||||
|
|
||||||
|
<demo-block :title="$t('labelDisabled')">
|
||||||
|
<van-checkbox v-model="checkbox3" label-disabled>{{ $t('checkbox') }} 2</van-checkbox>
|
||||||
|
<van-checkbox v-model="checkbox4" label-disabled>{{ $t('checkbox') }} 2</van-checkbox>
|
||||||
|
</demo-block>
|
||||||
|
|
||||||
<demo-block :title="$t('title3')">
|
<demo-block :title="$t('title3')">
|
||||||
<van-checkbox-group v-model="result">
|
<van-checkbox-group v-model="result">
|
||||||
<van-checkbox
|
<van-checkbox
|
||||||
@ -30,6 +35,16 @@
|
|||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
</van-checkbox-group>
|
</van-checkbox-group>
|
||||||
</demo-block>
|
</demo-block>
|
||||||
|
|
||||||
|
<demo-block :title="$t('title5')">
|
||||||
|
<van-checkbox-group v-model="result2" :max="max">
|
||||||
|
<van-cell-group>
|
||||||
|
<van-cell v-for="(item, index) in list" :key="index">
|
||||||
|
<van-checkbox :name="item">{{ $t('checkbox') }} {{ item }}</van-checkbox>
|
||||||
|
</van-cell>
|
||||||
|
</van-cell-group>
|
||||||
|
</van-checkbox-group>
|
||||||
|
</demo-block>
|
||||||
</demo-section>
|
</demo-section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -38,13 +53,17 @@ export default {
|
|||||||
i18n: {
|
i18n: {
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
checkbox: '复选框',
|
checkbox: '复选框',
|
||||||
|
labelDisabled: '禁用 Checkbox 内容部分点击事件',
|
||||||
title3: 'Checkbox 组',
|
title3: 'Checkbox 组',
|
||||||
title4: '与 Cell 组件一起使用'
|
title4: '与 Cell 组件一起使用',
|
||||||
|
title5: '设置最大可选数',
|
||||||
},
|
},
|
||||||
'en-US': {
|
'en-US': {
|
||||||
checkbox: 'Checkbox',
|
checkbox: 'Checkbox',
|
||||||
|
labelDisabled: 'Disable Checkbox Label click event',
|
||||||
title3: 'Checkbox Group',
|
title3: 'Checkbox Group',
|
||||||
title4: 'Inside a Cell'
|
title4: 'Inside a Cell',
|
||||||
|
title5: 'Maximum amount of checked options'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -52,12 +71,16 @@ export default {
|
|||||||
return {
|
return {
|
||||||
checkbox1: true,
|
checkbox1: true,
|
||||||
checkbox2: true,
|
checkbox2: true,
|
||||||
|
checkbox3: false,
|
||||||
|
checkbox4: true,
|
||||||
list: [
|
list: [
|
||||||
'a',
|
'a',
|
||||||
'b',
|
'b',
|
||||||
'c'
|
'c'
|
||||||
],
|
],
|
||||||
result: ['a', 'b']
|
result: ['a', 'b'],
|
||||||
|
result2: [],
|
||||||
|
max: 2
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -72,15 +95,13 @@ export default {
|
|||||||
.van-cell {
|
.van-cell {
|
||||||
.van-checkbox {
|
.van-checkbox {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
display: flex;
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
|
||||||
.van-checkbox__input {
|
&__label {
|
||||||
float: right;
|
|
||||||
position: static;
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
randomId(max = 999999) {
|
randomId(max = 999999) {
|
||||||
return Math.floor(Math.random() * max) + 1
|
return Math.floor(Math.random() * max) + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
<demo-section>
|
<demo-section>
|
||||||
<demo-block :title="$t('basicUsage')">
|
<demo-block :title="$t('basicUsage')">
|
||||||
<van-button @click="show1 = true">{{ $t('button1') }}</van-button>
|
<van-button @click="show1 = true">{{ $t('button1') }}</van-button>
|
||||||
<van-popup v-model="show1" :prevent-scroll="true">{{ $t('content') }}</van-popup>
|
<van-popup v-model="show1" prevent-scroll>{{ $t('content') }}</van-popup>
|
||||||
</demo-block>
|
</demo-block>
|
||||||
|
|
||||||
<demo-block :title="$t('position')">
|
<demo-block :title="$t('position')">
|
||||||
<van-button @click="show2 = true;">{{ $t('button2') }}</van-button>
|
<van-button @click="show2 = true;">{{ $t('button2') }}</van-button>
|
||||||
|
|
||||||
<van-popup v-model="show2" position="bottom" :prevent-scroll="true">
|
<van-popup v-model="show2" position="bottom" prevent-scroll>
|
||||||
<van-tabs>
|
<van-tabs>
|
||||||
<van-tab class="custom-pane" title="Tab1">
|
<van-tab class="custom-pane" title="Tab1">
|
||||||
<ul class="scroller">
|
<ul class="scroller">
|
||||||
|
@ -10,9 +10,10 @@
|
|||||||
:hide-stock="$t('sku').sku.hide_stock"
|
:hide-stock="$t('sku').sku.hide_stock"
|
||||||
:quota="$t('sku').quota"
|
:quota="$t('sku').quota"
|
||||||
:quota-used="$t('sku').quota_used"
|
:quota-used="$t('sku').quota_used"
|
||||||
:reset-stepper-on-hide="true"
|
reset-stepper-on-hide
|
||||||
:reset-selected-sku-on-hide="true"
|
reset-selected-sku-on-hide
|
||||||
:disable-stepper-input="true"
|
disable-stepper-input
|
||||||
|
:close-on-click-overlay="closeOnClickOverlay"
|
||||||
:message-config="messageConfig"
|
:message-config="messageConfig"
|
||||||
@buy-clicked="onBuyClicked"
|
@buy-clicked="onBuyClicked"
|
||||||
@add-cart="onAddCartClicked"
|
@add-cart="onAddCartClicked"
|
||||||
@ -48,10 +49,10 @@
|
|||||||
:goods="$t('sku').goods_info"
|
:goods="$t('sku').goods_info"
|
||||||
:goods-id="$t('sku').goods_id"
|
:goods-id="$t('sku').goods_id"
|
||||||
:hide-stock="$t('sku').sku.hide_stock"
|
:hide-stock="$t('sku').sku.hide_stock"
|
||||||
:show-add-cart-btn="true"
|
|
||||||
:quota="$t('sku').quota"
|
:quota="$t('sku').quota"
|
||||||
:quota-used="$t('sku').quota_used"
|
:quota-used="$t('sku').quota_used"
|
||||||
:reset-stepper-on-hide="true"
|
show-add-cart-btn
|
||||||
|
reset-stepper-on-hide
|
||||||
:initial-sku="initialSku"
|
:initial-sku="initialSku"
|
||||||
@buy-clicked="onBuyClicked"
|
@buy-clicked="onBuyClicked"
|
||||||
@add-cart="onAddCartClicked"
|
@add-cart="onAddCartClicked"
|
||||||
@ -96,6 +97,7 @@ export default {
|
|||||||
showBase: false,
|
showBase: false,
|
||||||
showCustom: false,
|
showCustom: false,
|
||||||
showStepper: false,
|
showStepper: false,
|
||||||
|
closeOnClickOverlay: true,
|
||||||
initialSku: {
|
initialSku: {
|
||||||
s1: '30349',
|
s1: '30349',
|
||||||
s2: '1193'
|
s2: '1193'
|
||||||
|
@ -16,6 +16,15 @@
|
|||||||
</van-swipe-item>
|
</van-swipe-item>
|
||||||
</van-swipe>
|
</van-swipe>
|
||||||
</demo-block>
|
</demo-block>
|
||||||
|
|
||||||
|
<demo-block :title="$t('title3')">
|
||||||
|
<van-swipe @change="onChange">
|
||||||
|
<van-swipe-item>1</van-swipe-item>
|
||||||
|
<van-swipe-item>2</van-swipe-item>
|
||||||
|
<van-swipe-item>3</van-swipe-item>
|
||||||
|
<van-swipe-item>4</van-swipe-item>
|
||||||
|
</van-swipe>
|
||||||
|
</demo-block>
|
||||||
</demo-section>
|
</demo-section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -23,10 +32,14 @@
|
|||||||
export default {
|
export default {
|
||||||
i18n: {
|
i18n: {
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
title2: '图片懒加载'
|
title2: '图片懒加载',
|
||||||
|
title3: '监听 change 事件',
|
||||||
|
message: '当前 Swipe 索引:'
|
||||||
},
|
},
|
||||||
'en-US': {
|
'en-US': {
|
||||||
title2: 'Image Lazyload'
|
title2: 'Image Lazyload',
|
||||||
|
title3: 'Change Event',
|
||||||
|
message: 'Current Swipe index:'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -39,6 +52,12 @@ export default {
|
|||||||
'https://img.yzcdn.cn/public_files/2017/09/05/fd08f07665ed67d50e11b32a21ce0682.jpg'
|
'https://img.yzcdn.cn/public_files/2017/09/05/fd08f07665ed67d50e11b32a21ce0682.jpg'
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
onChange(index) {
|
||||||
|
this.$toast(this.$t('message') + index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -106,7 +106,7 @@ export default {
|
|||||||
|
|
||||||
<style lang="postcss">
|
<style lang="postcss">
|
||||||
.demo-tab {
|
.demo-tab {
|
||||||
margin-bottom: 700px;
|
margin-bottom: 500px;
|
||||||
|
|
||||||
.van-tab .van-icon {
|
.van-tab .van-icon {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
|
@ -68,6 +68,7 @@ export default {
|
|||||||
| show-search-result | Whether to show address search result | `Boolean` | `false` | - |
|
| show-search-result | Whether to show address search result | `Boolean` | `false` | - |
|
||||||
| is-saving | Whether to show save button loading status | `Boolean` | `false` | - |
|
| is-saving | Whether to show save button loading status | `Boolean` | `false` | - |
|
||||||
| is-deleting | Whether to show delete button loading status | `Boolean` | `false` | - |
|
| is-deleting | Whether to show delete button loading status | `Boolean` | `false` | - |
|
||||||
|
| tel-validator | The method to validate tel | `(tel: string) => boolean` | - | - |
|
||||||
|
|
||||||
### Event
|
### Event
|
||||||
|
|
||||||
|
48
docs/markdown/en-US/built-in-style.md
Normal file
48
docs/markdown/en-US/built-in-style.md
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
## Built-in Style
|
||||||
|
Vant contains some common styles that can be used directly by the className.
|
||||||
|
|
||||||
|
### Text ellipsis
|
||||||
|
When the text content length exceeds the maximum container width, the excess text is automatically omitted.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<div class="van-ellipsis">
|
||||||
|
This is a paragraph of 250px width limit, the back will be omitted.
|
||||||
|
</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Hairline
|
||||||
|
Add 1px border under the Retina screen for the element, based on a pseudo element.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<!-- border top -->
|
||||||
|
<div class="van-hairline--top"></div>
|
||||||
|
|
||||||
|
<!-- border bottom -->
|
||||||
|
<div class="van-hairline--bottom"></div>
|
||||||
|
|
||||||
|
<!-- border left -->
|
||||||
|
<div class="van-hairline--left"></div>
|
||||||
|
|
||||||
|
<!-- border right -->
|
||||||
|
<div class="van-hairline--right"></div>
|
||||||
|
|
||||||
|
<!-- border top & bottom -->
|
||||||
|
<div class="van-hairline--top-bottom"></div>
|
||||||
|
|
||||||
|
<!-- full border -->
|
||||||
|
<div class="van-hairline--surround"></div>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Animation
|
||||||
|
|
||||||
|
```html
|
||||||
|
<!-- fade in -->
|
||||||
|
<transition name="van-fade">
|
||||||
|
<div v-show="visible">Fade</div>
|
||||||
|
</transition>
|
||||||
|
|
||||||
|
<!-- slide bottom -->
|
||||||
|
<transition name="van-slide-bottom">
|
||||||
|
<div v-show="visible">Fade</div>
|
||||||
|
</transition>
|
||||||
|
```
|
@ -1,5 +1,64 @@
|
|||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
### [0.12.12](https://github.com/youzan/vant/tree/v0.12.12)
|
||||||
|
`2018-03-06`
|
||||||
|
|
||||||
|
**Improvements**
|
||||||
|
|
||||||
|
* Swipe: support disable loop [\#670](https://github.com/youzan/vant/pull/670) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Document: add swipe change event demo [\#666](https://github.com/youzan/vant/pull/666) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* update static source CDN domain [\#652](https://github.com/youzan/vant/pull/652) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
|
||||||
|
**Bug Fixes**
|
||||||
|
|
||||||
|
* fix Field disabled color in safari [\#669](https://github.com/youzan/vant/pull/669) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* fix Swipe autoplay not stop when value set to 0 [\#660](https://github.com/youzan/vant/pull/660) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
|
||||||
|
|
||||||
|
### [0.12.11](https://github.com/youzan/vant/tree/v0.12.11)
|
||||||
|
`2018-02-27`
|
||||||
|
|
||||||
|
**Improvements**
|
||||||
|
|
||||||
|
* Checkbox: add label-disabled prop [\#644](https://github.com/youzan/vant/pull/644) [@ddchef](https://github.com/ddchef)
|
||||||
|
* Popup: add click-overlay event [\#647](https://github.com/youzan/vant/pull/647) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Icon: add warn icon [\#651](https://github.com/youzan/vant/pull/651) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Icon: add info-o icon, optimize checked & underway icon [\#648](https://github.com/youzan/vant/pull/648) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
|
||||||
|
**Bug Fixes**
|
||||||
|
|
||||||
|
* fix Button loading horizontal align [\#645](https://github.com/youzan/vant/pull/645) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
|
||||||
|
|
||||||
|
### [0.12.10](https://github.com/youzan/vant/tree/v0.12.10)
|
||||||
|
`2018-02-12`
|
||||||
|
|
||||||
|
**Improvements**
|
||||||
|
|
||||||
|
* add build-in style document [\#633](https://github.com/youzan/vant/pull/633) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Checkbox: optimzie DOM struct [\#636](https://github.com/youzan/vant/pull/636) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Checkbox: support config the maximum amount of checked options [\#631](https://github.com/youzan/vant/pull/631) [@mpandar](https://github.com/mpandar)
|
||||||
|
|
||||||
|
**Bug Fixes**
|
||||||
|
|
||||||
|
* Stepper: change event error when clear input [\#635](https://github.com/youzan/vant/pull/635) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
|
||||||
|
|
||||||
|
### [0.12.9](https://github.com/youzan/vant/tree/v0.12.9)
|
||||||
|
`2018-02-08`
|
||||||
|
|
||||||
|
**Improvements**
|
||||||
|
|
||||||
|
* PullRefresh: add refersh event [\#625](https://github.com/youzan/vant/pull/625) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Circle: optimzie linecap [\#624](https://github.com/youzan/vant/pull/624) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Picker: add loading prop [\#619](https://github.com/youzan/vant/pull/619) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Loading: add size prop [\#620](https://github.com/youzan/vant/pull/620) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Loading: add circular type [\#618](https://github.com/youzan/vant/pull/618) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Loading: change default type to circular [\#623](https://github.com/youzan/vant/pull/623) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
|
||||||
|
**Bug Fixes**
|
||||||
|
* fix Sku message observation [\#627](https://github.com/youzan/vant/pull/627) [@w91](https://github.com/w91)
|
||||||
|
|
||||||
|
|
||||||
### [0.12.8](https://github.com/youzan/vant/tree/v0.12.8)
|
### [0.12.8](https://github.com/youzan/vant/tree/v0.12.8)
|
||||||
`2018-02-07`
|
`2018-02-07`
|
||||||
|
@ -38,7 +38,7 @@ When Checkboxes are inside a CheckboxGroup, the checked checkboxes's name is an
|
|||||||
<van-checkbox-group v-model="result">
|
<van-checkbox-group v-model="result">
|
||||||
<van-checkbox
|
<van-checkbox
|
||||||
v-for="(item, index) in list"
|
v-for="(item, index) in list"
|
||||||
:key="index"
|
:key="item"
|
||||||
:name="item"
|
:name="item"
|
||||||
>
|
>
|
||||||
Checkbox {{ item }}
|
Checkbox {{ item }}
|
||||||
@ -57,24 +57,40 @@ export default {
|
|||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Maximum amount of checked options
|
||||||
|
|
||||||
|
```html
|
||||||
|
<van-checkbox-group v-model="result" :max="2">
|
||||||
|
<van-checkbox
|
||||||
|
v-for="(item, index) in list"
|
||||||
|
:name="item"
|
||||||
|
:key="item"
|
||||||
|
>
|
||||||
|
Checkbox {{ item }}
|
||||||
|
</van-checkbox>
|
||||||
|
</van-checkbox-group>
|
||||||
|
```
|
||||||
|
|
||||||
#### Inside a Cell
|
#### Inside a Cell
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-checkbox-group v-model="result">
|
<van-checkbox-group v-model="result">
|
||||||
<van-cell-group>
|
<van-cell-group>
|
||||||
<van-cell v-for="(item, index) in list" :key="index">
|
<van-cell v-for="(item, index) in list" :key="item">
|
||||||
<van-checkbox :name="item">Checkbox {{ item }}</van-checkbox>
|
<van-checkbox :name="item">Checkbox {{ item }}</van-checkbox>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
</van-checkbox-group>
|
</van-checkbox-group>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Checkbox API
|
### Checkbox API
|
||||||
|
|
||||||
| Attribute | Description | Type | Default | Accepted Values |
|
| Attribute | Description | Type | Default | Accepted Values |
|
||||||
|-----------|-----------|-----------|-------------|-------------|
|
|-----------|-----------|-----------|-------------|-------------|
|
||||||
| name | Checkbox name | `Boolean` | `false` | - |
|
| name | Checkbox name | `Boolean` | `false` | - |
|
||||||
| disabled | Diable checkbox | `Boolean` | `false` | - |
|
| disabled | Diable checkbox | `Boolean` | `false` | - |
|
||||||
|
| label-disabled | Whether to disable label click | `Boolean` | `false` | - |
|
||||||
| shape | Checkbox shape | `String` | `round` | `square` |
|
| shape | Checkbox shape | `String` | `round` | `square` |
|
||||||
|
|
||||||
### CheckboxGroup API
|
### CheckboxGroup API
|
||||||
@ -82,6 +98,7 @@ export default {
|
|||||||
| Attribute | Description | Type | Default | Accepted Values |
|
| Attribute | Description | Type | Default | Accepted Values |
|
||||||
|-----------|-----------|-----------|-------------|-------------|
|
|-----------|-----------|-----------|-------------|-------------|
|
||||||
| disabled | Disable all checkboxes | `Boolean` | `false` | - |
|
| disabled | Disable all checkboxes | `Boolean` | `false` | - |
|
||||||
|
| max | Maximum amount of checked options | `Number` | `0`(Unlimited) | - |
|
||||||
|
|
||||||
### Checkbox Event
|
### Checkbox Event
|
||||||
|
|
||||||
|
@ -161,6 +161,7 @@ export default {
|
|||||||
| is-edit | Whether is editing | `Boolean` | `false` | - |
|
| is-edit | Whether is editing | `Boolean` | `false` | - |
|
||||||
| is-saving | Whether to show save button loading status | `Boolean` | `false` | - |
|
| is-saving | Whether to show save button loading status | `Boolean` | `false` | - |
|
||||||
| is-deleting | Whether to show delete button loading status | `Boolean` | `false` | - |
|
| is-deleting | Whether to show delete button loading status | `Boolean` | `false` | - |
|
||||||
|
| tel-validator | The method to validate tel | `(tel: string) => boolean` | - | - |
|
||||||
|
|
||||||
### ContactEdit Event
|
### ContactEdit Event
|
||||||
|
|
||||||
|
@ -107,8 +107,8 @@ export default {
|
|||||||
| discount | Discount | `Number` |
|
| discount | Discount | `Number` |
|
||||||
| denominations | Denominations | `Number` |
|
| denominations | Denominations | `Number` |
|
||||||
| origin_condition | Condition | `Number` |
|
| origin_condition | Condition | `Number` |
|
||||||
| start_at | Start time | `Number` |
|
| start_at | Start time (Timestmap, unit second) | `Number` |
|
||||||
| end_at | End time | `Number` |
|
| end_at | End time (Timestmap, unit second) | `Number` |
|
||||||
| reason | Unavailable reason | `String` |
|
| reason | Unavailable reason | `String` |
|
||||||
| value | Value | `Number` |
|
| value | Value | `Number` |
|
||||||
|
|
||||||
|
@ -49,3 +49,9 @@ Use `position` prop to set popup display position
|
|||||||
| transition | Transition | `String` | `popup-slide` | - |
|
| transition | Transition | `String` | `popup-slide` | - |
|
||||||
| prevent-scroll | Prevent background scroll | `Boolean` | `false` | - |
|
| prevent-scroll | Prevent background scroll | `Boolean` | `false` | - |
|
||||||
| get-container | Return the mount node for Popup | `Function` | - | `() => HTMLElement` |
|
| get-container | Return the mount node for Popup | `Function` | - | `() => HTMLElement` |
|
||||||
|
|
||||||
|
### Event
|
||||||
|
|
||||||
|
| Event | Description | Arguments |
|
||||||
|
|-----------|-----------|-----------|
|
||||||
|
| click-overlay | Triggered when click overlay | - |
|
||||||
|
@ -34,7 +34,7 @@ import { Button } from 'vant';
|
|||||||
#### 2. Manually import
|
#### 2. Manually import
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { Button } from 'vant/lib/button';
|
import Button from 'vant/lib/button';
|
||||||
import 'vant/lib/vant-css/base.css';
|
import 'vant/lib/vant-css/base.css';
|
||||||
import 'vant/lib/vant-css/button.css';
|
import 'vant/lib/vant-css/button.css';
|
||||||
```
|
```
|
||||||
|
@ -21,6 +21,7 @@ Vue.use(Sku);
|
|||||||
:quota-used="quotaUsed"
|
:quota-used="quotaUsed"
|
||||||
:reset-stepper-on-hide="resetStepperOnHide"
|
:reset-stepper-on-hide="resetStepperOnHide"
|
||||||
:reset-selected-sku-on-hide="resetSelectedSkuOnHide"
|
:reset-selected-sku-on-hide="resetSelectedSkuOnHide"
|
||||||
|
:close-on-click-overlay="closeOnClickOverlay"
|
||||||
:disable-stepper-input="disableStepperInput"
|
:disable-stepper-input="disableStepperInput"
|
||||||
:message-config="messageConfig"
|
:message-config="messageConfig"
|
||||||
@buy-clicked="onBuyClicked"
|
@buy-clicked="onBuyClicked"
|
||||||
@ -55,10 +56,10 @@ Vue.use(Sku);
|
|||||||
:goods="goods"
|
:goods="goods"
|
||||||
:goods-id="goodsId"
|
:goods-id="goodsId"
|
||||||
:hide-stock="sku.hide_stock"
|
:hide-stock="sku.hide_stock"
|
||||||
:show-add-cart-btn="true"
|
|
||||||
:quota="quota"
|
:quota="quota"
|
||||||
:quota-used="quotaUsed"
|
:quota-used="quotaUsed"
|
||||||
:reset-stepper-on-hide="true"
|
show-add-cart-btn
|
||||||
|
reset-stepper-on-hide
|
||||||
:initial-sku="initialSku"
|
:initial-sku="initialSku"
|
||||||
@buy-clicked="onBuyClicked"
|
@buy-clicked="onBuyClicked"
|
||||||
@add-cart="onAddCartClicked"
|
@add-cart="onAddCartClicked"
|
||||||
@ -89,6 +90,7 @@ Vue.use(Sku);
|
|||||||
| reset-stepper-on-hide | Whether to reset stepper when hide | `Boolean` | `false` | - |
|
| reset-stepper-on-hide | Whether to reset stepper when hide | `Boolean` | `false` | - |
|
||||||
| reset-selected-sku-on-hide | Whether to reset selected sku when hide | `Boolean` | `false` | - |
|
| reset-selected-sku-on-hide | Whether to reset selected sku when hide | `Boolean` | `false` | - |
|
||||||
| disable-stepper-input | Whether to disable stepper input | `Boolean` | `false` | - |
|
| disable-stepper-input | Whether to disable stepper input | `Boolean` | `false` | - |
|
||||||
|
| close-on-click-overlay | Whether to close sku popup when click overlay | `Boolean` | `false` | - |
|
||||||
| stepper-title | Quantity title | `String` | `Quantity` | - |
|
| stepper-title | Quantity title | `String` | `Quantity` | - |
|
||||||
| custom-stepper-config | Custom stepper related config | `Object` | `{}` | - |
|
| custom-stepper-config | Custom stepper related config | `Object` | `{}` | - |
|
||||||
| message-config | Message related config | `Object` | `{}` | - |
|
| message-config | Message related config | `Object` | `{}` | - |
|
||||||
|
@ -45,12 +45,34 @@ export default {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### change event
|
||||||
|
|
||||||
|
```html
|
||||||
|
<van-swipe @change="onChange">
|
||||||
|
<van-swipe-item>1</van-swipe-item>
|
||||||
|
<van-swipe-item>2</van-swipe-item>
|
||||||
|
<van-swipe-item>3</van-swipe-item>
|
||||||
|
<van-swipe-item>4</van-swipe-item>
|
||||||
|
</van-swipe>
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
export default {
|
||||||
|
methods: {
|
||||||
|
onChange(index) {
|
||||||
|
Toast('Current Swipe index:' + index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### API
|
### API
|
||||||
|
|
||||||
| Attribute | Description | Type | Default | Accepted Values |
|
| Attribute | Description | Type | Default | Accepted Values |
|
||||||
|-----------|-----------|-----------|-------------|-------------|
|
|-----------|-----------|-----------|-------------|-------------|
|
||||||
| autoplay | Autoplay interval (ms) | `Number` | - | - |
|
| autoplay | Autoplay interval (ms) | `Number` | - | - |
|
||||||
| duration | Animation duration (ms) | `Number` | `500` | - |
|
| duration | Animation duration (ms) | `Number` | `500` | - |
|
||||||
|
| loop | Whether to enable loop | `Boolean` | `true` | - |
|
||||||
| show-indicators | Whether to show indocators | `Boolean` | `true` | - |
|
| show-indicators | Whether to show indocators | `Boolean` | `true` | - |
|
||||||
| initial-swipe | Index of initial swipe, start from 0 | `Number` | `0` | - |
|
| initial-swipe | Index of initial swipe, start from 0 | `Number` | `0` | - |
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ export default {
|
|||||||
'zh-CN/address-list': wrapper(r => require.ensure([], () => r(require('./zh-CN/address-list.md')), 'zh-CN/address-list')),
|
'zh-CN/address-list': wrapper(r => require.ensure([], () => r(require('./zh-CN/address-list.md')), 'zh-CN/address-list')),
|
||||||
'zh-CN/area': wrapper(r => require.ensure([], () => r(require('./zh-CN/area.md')), 'zh-CN/area')),
|
'zh-CN/area': wrapper(r => require.ensure([], () => r(require('./zh-CN/area.md')), 'zh-CN/area')),
|
||||||
'zh-CN/badge': wrapper(r => require.ensure([], () => r(require('./zh-CN/badge.md')), 'zh-CN/badge')),
|
'zh-CN/badge': wrapper(r => require.ensure([], () => r(require('./zh-CN/badge.md')), 'zh-CN/badge')),
|
||||||
|
'zh-CN/built-in-style': wrapper(r => require.ensure([], () => r(require('./zh-CN/built-in-style.md')), 'zh-CN/built-in-style')),
|
||||||
'zh-CN/button': wrapper(r => require.ensure([], () => r(require('./zh-CN/button.md')), 'zh-CN/button')),
|
'zh-CN/button': wrapper(r => require.ensure([], () => r(require('./zh-CN/button.md')), 'zh-CN/button')),
|
||||||
'zh-CN/card': wrapper(r => require.ensure([], () => r(require('./zh-CN/card.md')), 'zh-CN/card')),
|
'zh-CN/card': wrapper(r => require.ensure([], () => r(require('./zh-CN/card.md')), 'zh-CN/card')),
|
||||||
'zh-CN/cell-swipe': wrapper(r => require.ensure([], () => r(require('./zh-CN/cell-swipe.md')), 'zh-CN/cell-swipe')),
|
'zh-CN/cell-swipe': wrapper(r => require.ensure([], () => r(require('./zh-CN/cell-swipe.md')), 'zh-CN/cell-swipe')),
|
||||||
@ -72,6 +73,7 @@ export default {
|
|||||||
'en-US/address-list': wrapper(r => require.ensure([], () => r(require('./en-US/address-list.md')), 'en-US/address-list')),
|
'en-US/address-list': wrapper(r => require.ensure([], () => r(require('./en-US/address-list.md')), 'en-US/address-list')),
|
||||||
'en-US/area': wrapper(r => require.ensure([], () => r(require('./en-US/area.md')), 'en-US/area')),
|
'en-US/area': wrapper(r => require.ensure([], () => r(require('./en-US/area.md')), 'en-US/area')),
|
||||||
'en-US/badge': wrapper(r => require.ensure([], () => r(require('./en-US/badge.md')), 'en-US/badge')),
|
'en-US/badge': wrapper(r => require.ensure([], () => r(require('./en-US/badge.md')), 'en-US/badge')),
|
||||||
|
'en-US/built-in-style': wrapper(r => require.ensure([], () => r(require('./en-US/built-in-style.md')), 'en-US/built-in-style')),
|
||||||
'en-US/button': wrapper(r => require.ensure([], () => r(require('./en-US/button.md')), 'en-US/button')),
|
'en-US/button': wrapper(r => require.ensure([], () => r(require('./en-US/button.md')), 'en-US/button')),
|
||||||
'en-US/card': wrapper(r => require.ensure([], () => r(require('./en-US/card.md')), 'en-US/card')),
|
'en-US/card': wrapper(r => require.ensure([], () => r(require('./en-US/card.md')), 'en-US/card')),
|
||||||
'en-US/cell-swipe': wrapper(r => require.ensure([], () => r(require('./en-US/cell-swipe.md')), 'en-US/cell-swipe')),
|
'en-US/cell-swipe': wrapper(r => require.ensure([], () => r(require('./en-US/cell-swipe.md')), 'en-US/cell-swipe')),
|
||||||
|
@ -67,6 +67,7 @@ export default {
|
|||||||
| show-search-result | 是否显示搜索结果 | `Boolean` | `false` | - |
|
| show-search-result | 是否显示搜索结果 | `Boolean` | `false` | - |
|
||||||
| is-saving | 是否显示保存按钮加载动画 | `Boolean` | `false` | - |
|
| is-saving | 是否显示保存按钮加载动画 | `Boolean` | `false` | - |
|
||||||
| is-deleting | 是否显示删除按钮加载动画 | `Boolean` | `false` | - |
|
| is-deleting | 是否显示删除按钮加载动画 | `Boolean` | `false` | - |
|
||||||
|
| tel-validator | 手机号格式校验函数 | `(tel: string) => boolean` | - | - |
|
||||||
|
|
||||||
### Event
|
### Event
|
||||||
|
|
||||||
|
47
docs/markdown/zh-CN/built-in-style.md
Normal file
47
docs/markdown/zh-CN/built-in-style.md
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
## 内置样式
|
||||||
|
Vant 中默认包含了一些常用样式,可以直接通过 className 的方式使用。
|
||||||
|
|
||||||
|
### 文字省略
|
||||||
|
当文本内容长度超过容器最大宽度时,自动省略多余的文本。
|
||||||
|
|
||||||
|
```html
|
||||||
|
<div class="van-ellipsis">这是一段宽度限制 250px 的文字,后面的内容会省略</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1px 边框
|
||||||
|
为元素添加 Retina 屏幕下的 1px 边框(即 hairline),基于伪类 transform 实现。
|
||||||
|
|
||||||
|
```html
|
||||||
|
<!-- 上边框 -->
|
||||||
|
<div class="van-hairline--top"></div>
|
||||||
|
|
||||||
|
<!-- 下边框 -->
|
||||||
|
<div class="van-hairline--bottom"></div>
|
||||||
|
|
||||||
|
<!-- 左边框 -->
|
||||||
|
<div class="van-hairline--left"></div>
|
||||||
|
|
||||||
|
<!-- 右边框 -->
|
||||||
|
<div class="van-hairline--right"></div>
|
||||||
|
|
||||||
|
<!-- 上下边框 -->
|
||||||
|
<div class="van-hairline--top-bottom"></div>
|
||||||
|
|
||||||
|
<!-- 全边框 -->
|
||||||
|
<div class="van-hairline--surround"></div>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 动画
|
||||||
|
可以通过 `transition` 组件使用内置的动画
|
||||||
|
|
||||||
|
```html
|
||||||
|
<!-- 淡入 -->
|
||||||
|
<transition name="van-fade">
|
||||||
|
<div v-show="visible">Fade</div>
|
||||||
|
</transition>
|
||||||
|
|
||||||
|
<!-- 下滑 -->
|
||||||
|
<transition name="van-slide-bottom">
|
||||||
|
<div v-show="visible">Fade</div>
|
||||||
|
</transition>
|
||||||
|
```
|
@ -1,5 +1,95 @@
|
|||||||
## 更新日志
|
## 更新日志
|
||||||
|
|
||||||
|
## [v0.12.12](https://github.com/youzan/vant/tree/v0.12.12) (2018-03-06)
|
||||||
|
[Full Changelog](https://github.com/youzan/vant/compare/v0.12.11...v0.12.12)
|
||||||
|
|
||||||
|
**Issue**
|
||||||
|
|
||||||
|
- Tabs 组件的sticky设置 [\#662](https://github.com/youzan/vant/issues/662)
|
||||||
|
- Sku组件有问题 [\#659](https://github.com/youzan/vant/issues/659)
|
||||||
|
- checkbox/radio选项不支持溢出文本 [\#658](https://github.com/youzan/vant/issues/658)
|
||||||
|
- Search组件输入内容在 iphone 内显示不完整 [\#657](https://github.com/youzan/vant/issues/657)
|
||||||
|
- van-button组件在loading时,loading图标不居中 [\#655](https://github.com/youzan/vant/issues/655)
|
||||||
|
- 建议增加Scroller组件,能够无限加载,下拉刷新 [\#654](https://github.com/youzan/vant/issues/654)
|
||||||
|
- Icon 浏览器兼容 [\#653](https://github.com/youzan/vant/issues/653)
|
||||||
|
- Popup以及Picker同时使用时存在的一个问题,是否能考虑在Popup点击遮罩层关闭时提供相应的事件 [\#646](https://github.com/youzan/vant/issues/646)
|
||||||
|
- 新增加的功能 [\#643](https://github.com/youzan/vant/issues/643)
|
||||||
|
|
||||||
|
**Improvements**
|
||||||
|
|
||||||
|
- \[new feature\] Swipe: support disable loop [\#670](https://github.com/youzan/vant/pull/670) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[bugfix\] Field: disabled color in safari [\#669](https://github.com/youzan/vant/pull/669) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[Doc\] swipe: add change event demo [\#666](https://github.com/youzan/vant/pull/666) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[Doc\] fix Tab demo & update dependencies [\#665](https://github.com/youzan/vant/pull/665) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[Improvement\] optimize utils [\#661](https://github.com/youzan/vant/pull/661) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[bugfix\] Swipe: autoplay not stop when value set to 0 [\#660](https://github.com/youzan/vant/pull/660) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[Improvement\] update CDN domain [\#652](https://github.com/youzan/vant/pull/652) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
|
||||||
|
## [v0.12.11](https://github.com/youzan/vant/tree/v0.12.11) (2018-02-27)
|
||||||
|
[Full Changelog](https://github.com/youzan/vant/compare/v0.12.10...v0.12.11)
|
||||||
|
|
||||||
|
**Issue**
|
||||||
|
|
||||||
|
- picker如何设置初始选中默认值? [\#649](https://github.com/youzan/vant/issues/649)
|
||||||
|
- 官方可以在release里面提供编译后的js文件吗,可以直接用在html里面那种 [\#642](https://github.com/youzan/vant/issues/642)
|
||||||
|
- Vue.prototype.$toast = Toast [\#641](https://github.com/youzan/vant/issues/641)
|
||||||
|
- ImagePreview鼠标单击图片外的黑色背景部分,无法关闭 [\#637](https://github.com/youzan/vant/issues/637)
|
||||||
|
- van-stepper 的异常 [\#634](https://github.com/youzan/vant/issues/634)
|
||||||
|
- 期待checkbox支持最大选择数量功能 [\#617](https://github.com/youzan/vant/issues/617)
|
||||||
|
|
||||||
|
**Improvements**
|
||||||
|
|
||||||
|
- \[Improvement\] Icon: add warn icon [\#651](https://github.com/youzan/vant/pull/651) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[Improvement\] add checkbox labelDisabled test case [\#650](https://github.com/youzan/vant/pull/650) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[Improvement\] Icon: add info-o icon [\#648](https://github.com/youzan/vant/pull/648) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[Improvement\] Popup: add click-overlay event [\#647](https://github.com/youzan/vant/pull/647) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[bugfix\] Button loading horizontal align [\#645](https://github.com/youzan/vant/pull/645) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[new feature\]Checkbox: support disabled label [\#644](https://github.com/youzan/vant/pull/644) ([ddchef](https://github.com/ddchef))
|
||||||
|
|
||||||
|
## [v0.12.10](https://github.com/youzan/vant/tree/v0.12.10) (2018-02-12)
|
||||||
|
[Full Changelog](https://github.com/youzan/vant/compare/v0.12.9...v0.12.10)
|
||||||
|
|
||||||
|
**Issue**
|
||||||
|
|
||||||
|
- 这个参数到底是毫秒还是秒,还是分钟呀?! [\#632](https://github.com/youzan/vant/issues/632)
|
||||||
|
- 建议Toast.loading 增加一个 loading关闭api [\#629](https://github.com/youzan/vant/issues/629)
|
||||||
|
- 修改地址时,怎么设置默认值 [\#628](https://github.com/youzan/vant/issues/628)
|
||||||
|
- pull-refresh [\#622](https://github.com/youzan/vant/issues/622)
|
||||||
|
- Actionsheet 没有设置默认选中的啊 [\#621](https://github.com/youzan/vant/issues/621)
|
||||||
|
|
||||||
|
**Improvements**
|
||||||
|
|
||||||
|
- \[Doc\] optimzie router & remove unused code [\#640](https://github.com/youzan/vant/pull/640) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- simplify test config [\#639](https://github.com/youzan/vant/pull/639) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- simplify build config [\#638](https://github.com/youzan/vant/pull/638) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[Improvement\] Checkbox: remove unnecessary DOM [\#636](https://github.com/youzan/vant/pull/636) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[bugfix\] Stepper: change event error when clear input [\#635](https://github.com/youzan/vant/pull/635) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[Doc\] add build-in style document [\#633](https://github.com/youzan/vant/pull/633) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[new feature\] Checkbox: support config the maximum amount of checked options [\#631](https://github.com/youzan/vant/pull/631) ([mpandar](https://github.com/mpandar))
|
||||||
|
|
||||||
|
## [v0.12.9](https://github.com/youzan/vant/tree/v0.12.9) (2018-02-08)
|
||||||
|
[Full Changelog](https://github.com/youzan/vant/compare/v0.12.8...v0.12.9)
|
||||||
|
|
||||||
|
**Breaking changes**
|
||||||
|
|
||||||
|
- 能否增加一个进度环组件Circle [\#599](https://github.com/youzan/vant/issues/599)
|
||||||
|
|
||||||
|
**Issue**
|
||||||
|
|
||||||
|
- PullRefresh 下拉刷新?没有下拉加载。。。社区怎么没人啊? [\#614](https://github.com/youzan/vant/issues/614)
|
||||||
|
- tabs 的title能否加个slot? [\#574](https://github.com/youzan/vant/issues/574)
|
||||||
|
|
||||||
|
**Improvements**
|
||||||
|
|
||||||
|
- \[bugfix\] 修复sku数据改变后skuMessages没有更新的bug [\#627](https://github.com/youzan/vant/pull/627) ([w91](https://github.com/w91))
|
||||||
|
- \[Doc\] optimzie demo display [\#626](https://github.com/youzan/vant/pull/626) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[Improvement\] PullRefresh: add refersh event [\#625](https://github.com/youzan/vant/pull/625) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[Improvement\] Circle: optimzie linecap [\#624](https://github.com/youzan/vant/pull/624) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[Improvement\] Loading: change default type to circular [\#623](https://github.com/youzan/vant/pull/623) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[Improvement\] Loading: add size prop [\#620](https://github.com/youzan/vant/pull/620) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[new feature\] Picker: add loading prop [\#619](https://github.com/youzan/vant/pull/619) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
- \[new feature\] Loading: add circular type [\#618](https://github.com/youzan/vant/pull/618) ([chenjiahan](https://github.com/chenjiahan))
|
||||||
|
|
||||||
## [v0.12.8](https://github.com/youzan/vant/tree/v0.12.8) (2018-02-07)
|
## [v0.12.8](https://github.com/youzan/vant/tree/v0.12.8) (2018-02-07)
|
||||||
[Full Changelog](https://github.com/youzan/vant/compare/v0.12.7...v0.12.8)
|
[Full Changelog](https://github.com/youzan/vant/compare/v0.12.7...v0.12.8)
|
||||||
|
|
||||||
|
@ -1,5 +1,62 @@
|
|||||||
## 更新日志
|
## 更新日志
|
||||||
|
|
||||||
|
### [0.12.12](https://github.com/youzan/vant/tree/v0.12.12)
|
||||||
|
`2018-03-06`
|
||||||
|
|
||||||
|
**Improvements**
|
||||||
|
|
||||||
|
* Swipe: 新增 loop 属性,支持禁用循环滚动 [\#670](https://github.com/youzan/vant/pull/670) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Document: 新增 change 事件示例 [\#666](https://github.com/youzan/vant/pull/666) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* 更新静态资源 CDN 域名 [\#652](https://github.com/youzan/vant/pull/652) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
|
||||||
|
**Bug Fixes**
|
||||||
|
|
||||||
|
* 修复 Field 在 safari 下禁用态颜色过浅的问题 [\#669](https://github.com/youzan/vant/pull/669) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* 修复 Swipe autoplay 设置为 0 时不会立刻取消的问题 [\#660](https://github.com/youzan/vant/pull/660) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
|
||||||
|
### [0.12.11](https://github.com/youzan/vant/tree/v0.12.11)
|
||||||
|
`2018-02-27`
|
||||||
|
|
||||||
|
**Improvements**
|
||||||
|
|
||||||
|
* Checkbox: 新增 label-disabled 属性,支持禁用 label 点击 [\#644](https://github.com/youzan/vant/pull/644) [@ddchef](https://github.com/ddchef)
|
||||||
|
* Popup: 新增 click-overlay 事件 [\#647](https://github.com/youzan/vant/pull/647) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Icon: 新增 warn 图标 [\#651](https://github.com/youzan/vant/pull/651) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Icon: 新增 info-o 图标, 优化 checked & underway 图标 [\#648](https://github.com/youzan/vant/pull/648) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
|
||||||
|
**Bug Fixes**
|
||||||
|
|
||||||
|
* 修复 Button loading 样式未居中的问题 [\#645](https://github.com/youzan/vant/pull/645) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
|
||||||
|
### [0.12.10](https://github.com/youzan/vant/tree/v0.12.10)
|
||||||
|
`2018-02-12`
|
||||||
|
|
||||||
|
**Improvements**
|
||||||
|
|
||||||
|
* 新增内置样式文档 [\#633](https://github.com/youzan/vant/pull/633) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Checkbox: 优化 DOM 结构 [\#636](https://github.com/youzan/vant/pull/636) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Checkbox: 支持设置最大可选数 [\#631](https://github.com/youzan/vant/pull/631) [@mpandar](https://github.com/mpandar)
|
||||||
|
|
||||||
|
**Bug Fixes**
|
||||||
|
|
||||||
|
* Stepper: 修复清空输入框时 change 事件未正确触发的问题 [\#635](https://github.com/youzan/vant/pull/635) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
|
||||||
|
### [0.12.9](https://github.com/youzan/vant/tree/v0.12.9)
|
||||||
|
`2018-02-08`
|
||||||
|
|
||||||
|
**Improvements**
|
||||||
|
|
||||||
|
* PullRefresh: 新增 refersh 事件 [\#625](https://github.com/youzan/vant/pull/625) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Circle: 优化线条圆角 [\#624](https://github.com/youzan/vant/pull/624) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Picker: 新增 loading 属性 [\#619](https://github.com/youzan/vant/pull/619) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Loading: 新增 size 属性 [\#620](https://github.com/youzan/vant/pull/620) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Loading: 新增 circular 类型 [\#618](https://github.com/youzan/vant/pull/618) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
* Loading: 默认类型调整为 circular [\#623](https://github.com/youzan/vant/pull/623) [@chenjiahan](https://github.com/chenjiahan)
|
||||||
|
|
||||||
|
**Bug Fixes**
|
||||||
|
* 修复 Sku message 更新时未重新渲染的问题 [\#627](https://github.com/youzan/vant/pull/627) [@w91](https://github.com/w91)
|
||||||
|
|
||||||
|
|
||||||
### [0.12.8](https://github.com/youzan/vant/tree/v0.12.8)
|
### [0.12.8](https://github.com/youzan/vant/tree/v0.12.8)
|
||||||
`2018-02-07`
|
`2018-02-07`
|
||||||
|
|
||||||
|
@ -31,7 +31,11 @@ export default {
|
|||||||
```html
|
```html
|
||||||
<van-checkbox v-model="checked" disabled>复选框 2</van-checkbox>
|
<van-checkbox v-model="checked" disabled>复选框 2</van-checkbox>
|
||||||
```
|
```
|
||||||
|
#### 禁用内容部分点击事件
|
||||||
|
|
||||||
|
```html
|
||||||
|
<van-checkbox v-model="checked" label-disabled>复选框 3</van-checkbox>
|
||||||
|
```
|
||||||
#### Checkbox 组
|
#### Checkbox 组
|
||||||
|
|
||||||
需要与`van-checkbox-group`一起使用,选中值是一个数组,通过`v-model`绑定在`van-checkbox-group`上,数组中的项即为选中的`Checkbox`的`name`属性设置的值
|
需要与`van-checkbox-group`一起使用,选中值是一个数组,通过`v-model`绑定在`van-checkbox-group`上,数组中的项即为选中的`Checkbox`的`name`属性设置的值
|
||||||
@ -40,7 +44,7 @@ export default {
|
|||||||
<van-checkbox-group v-model="result">
|
<van-checkbox-group v-model="result">
|
||||||
<van-checkbox
|
<van-checkbox
|
||||||
v-for="(item, index) in list"
|
v-for="(item, index) in list"
|
||||||
:key="index"
|
:key="item"
|
||||||
:name="item"
|
:name="item"
|
||||||
>
|
>
|
||||||
复选框 {{ item }}
|
复选框 {{ item }}
|
||||||
@ -59,6 +63,20 @@ export default {
|
|||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### 设置最大可选数
|
||||||
|
|
||||||
|
```html
|
||||||
|
<van-checkbox-group v-model="result" :max="2">
|
||||||
|
<van-checkbox
|
||||||
|
v-for="(item, index) in list"
|
||||||
|
:key="item"
|
||||||
|
:name="item"
|
||||||
|
>
|
||||||
|
复选框 {{ item }}
|
||||||
|
</van-checkbox>
|
||||||
|
</van-checkbox-group>
|
||||||
|
```
|
||||||
|
|
||||||
#### 与 Cell 组件一起使用
|
#### 与 Cell 组件一起使用
|
||||||
|
|
||||||
此时你需要再引入`Cell`和`CellGroup`组件
|
此时你需要再引入`Cell`和`CellGroup`组件
|
||||||
@ -66,7 +84,7 @@ export default {
|
|||||||
```html
|
```html
|
||||||
<van-checkbox-group v-model="result">
|
<van-checkbox-group v-model="result">
|
||||||
<van-cell-group>
|
<van-cell-group>
|
||||||
<van-cell v-for="(item, index) in list" :key="index">
|
<van-cell v-for="(item, index) in list" :key="item">
|
||||||
<van-checkbox :name="item">复选框 {{ item }}</van-checkbox>
|
<van-checkbox :name="item">复选框 {{ item }}</van-checkbox>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
@ -79,6 +97,7 @@ export default {
|
|||||||
|-----------|-----------|-----------|-------------|-------------|
|
|-----------|-----------|-----------|-------------|-------------|
|
||||||
| name | 标识 Checkbox 名称 | `Boolean` | `false` | - |
|
| name | 标识 Checkbox 名称 | `Boolean` | `false` | - |
|
||||||
| disabled | 是否禁用单选框 | `Boolean` | `false` | - |
|
| disabled | 是否禁用单选框 | `Boolean` | `false` | - |
|
||||||
|
| label-disabled | 是否禁用单选框内容点击 | `Boolean` | `false` | - |
|
||||||
| shape | 形状 | `String` | `round` | `square` |
|
| shape | 形状 | `String` | `round` | `square` |
|
||||||
|
|
||||||
### CheckboxGroup API
|
### CheckboxGroup API
|
||||||
@ -86,6 +105,7 @@ export default {
|
|||||||
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
||||||
|-----------|-----------|-----------|-------------|-------------|
|
|-----------|-----------|-----------|-------------|-------------|
|
||||||
| disabled | 是否禁用所有单选框 | `Boolean` | `false` | - |
|
| disabled | 是否禁用所有单选框 | `Boolean` | `false` | - |
|
||||||
|
| max | 设置最大可选数 | `Number` | `0`(无限制) | - |
|
||||||
|
|
||||||
### Checkbox Event
|
### Checkbox Event
|
||||||
|
|
||||||
|
@ -162,6 +162,7 @@ export default {
|
|||||||
| is-edit | 是否为编辑联系人 | `Boolean` | `false` | - |
|
| is-edit | 是否为编辑联系人 | `Boolean` | `false` | - |
|
||||||
| is-saving | 是否显示保存按钮加载动画 | `Boolean` | `false` | - |
|
| is-saving | 是否显示保存按钮加载动画 | `Boolean` | `false` | - |
|
||||||
| is-deleting | 是否显示删除按钮加载动画 | `Boolean` | `false` | - |
|
| is-deleting | 是否显示删除按钮加载动画 | `Boolean` | `false` | - |
|
||||||
|
| tel-validator | 手机号格式校验函数 | `(tel: string) => boolean` | - | - |
|
||||||
|
|
||||||
### ContactEdit Event
|
### ContactEdit Event
|
||||||
|
|
||||||
|
@ -110,8 +110,7 @@ export default {
|
|||||||
| discount | 折扣(0为满减券)88=>8.8折 | `Number` |
|
| discount | 折扣(0为满减券)88=>8.8折 | `Number` |
|
||||||
| denominations | 面值(0为折扣券)单位分 | `Number` |
|
| denominations | 面值(0为折扣券)单位分 | `Number` |
|
||||||
| origin_condition | 满减条件(0为无门槛,满XX元可用)单位分 | `Number` |
|
| origin_condition | 满减条件(0为无门槛,满XX元可用)单位分 | `Number` |
|
||||||
| start_at | 卡有效开始时间 | `Number` |
|
| start_at | 卡有效开始时间 (时间戳, 单位秒) | `Number` |
|
||||||
| end_at | 卡失效日期 | `Number` |
|
| end_at | 卡失效日期 (时间戳, 单位秒) | `Number` |
|
||||||
| reason | 不可用原因 | `String` |
|
| reason | 不可用原因 | `String` |
|
||||||
| value | 订单优惠金额,单位分 | `Number` |
|
| value | 订单优惠金额,单位分 | `Number` |
|
||||||
|
|
||||||
|
@ -49,3 +49,9 @@ export default {
|
|||||||
| transition | transition 名称 | `String` | `popup-slide` | - |
|
| transition | transition 名称 | `String` | `popup-slide` | - |
|
||||||
| prevent-scroll | 是否防止滚动穿透 | `Boolean` | `false` | - |
|
| prevent-scroll | 是否防止滚动穿透 | `Boolean` | `false` | - |
|
||||||
| get-container | 指定弹出层挂载的 HTML 节点 | `Function` | - | `() => HTMLElement` |
|
| get-container | 指定弹出层挂载的 HTML 节点 | `Function` | - | `() => HTMLElement` |
|
||||||
|
|
||||||
|
### Event
|
||||||
|
|
||||||
|
| 事件名 | 说明 | 参数 |
|
||||||
|
|-----------|-----------|-----------|
|
||||||
|
| click-overlay | 点击蒙层时触发 | - |
|
||||||
|
@ -32,7 +32,7 @@ import { Button } from 'vant';
|
|||||||
#### 方式二. 按需引入组件
|
#### 方式二. 按需引入组件
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { Button } from 'vant/lib/button';
|
import Button from 'vant/lib/button';
|
||||||
import 'vant/lib/vant-css/base.css';
|
import 'vant/lib/vant-css/base.css';
|
||||||
import 'vant/lib/vant-css/button.css';
|
import 'vant/lib/vant-css/button.css';
|
||||||
```
|
```
|
||||||
|
@ -21,6 +21,7 @@ Vue.use(Sku);
|
|||||||
:quota-used="quotaUsed"
|
:quota-used="quotaUsed"
|
||||||
:reset-stepper-on-hide="resetStepperOnHide"
|
:reset-stepper-on-hide="resetStepperOnHide"
|
||||||
:reset-selected-sku-on-hide="resetSelectedSkuOnHide"
|
:reset-selected-sku-on-hide="resetSelectedSkuOnHide"
|
||||||
|
:close-on-click-overlay="closeOnClickOverlay"
|
||||||
:disable-stepper-input="disableStepperInput"
|
:disable-stepper-input="disableStepperInput"
|
||||||
:message-config="messageConfig"
|
:message-config="messageConfig"
|
||||||
@buy-clicked="onBuyClicked"
|
@buy-clicked="onBuyClicked"
|
||||||
@ -55,10 +56,10 @@ Vue.use(Sku);
|
|||||||
:goods="goods"
|
:goods="goods"
|
||||||
:goods-id="goodsId"
|
:goods-id="goodsId"
|
||||||
:hide-stock="sku.hide_stock"
|
:hide-stock="sku.hide_stock"
|
||||||
:show-add-cart-btn="true"
|
|
||||||
:quota="quota"
|
:quota="quota"
|
||||||
:quota-used="quotaUsed"
|
:quota-used="quotaUsed"
|
||||||
:reset-stepper-on-hide="true"
|
show-add-cart-btn
|
||||||
|
reset-stepper-on-hide
|
||||||
:initial-sku="initialSku"
|
:initial-sku="initialSku"
|
||||||
@buy-clicked="onBuyClicked"
|
@buy-clicked="onBuyClicked"
|
||||||
@add-cart="onAddCartClicked"
|
@add-cart="onAddCartClicked"
|
||||||
@ -90,6 +91,7 @@ Vue.use(Sku);
|
|||||||
| reset-stepper-on-hide | 窗口隐藏时重置选择的商品数量 | `Boolean` | `false` | - |
|
| reset-stepper-on-hide | 窗口隐藏时重置选择的商品数量 | `Boolean` | `false` | - |
|
||||||
| reset-selected-sku-on-hide | 窗口隐藏时重置已选择的sku | `Boolean` | `false` | - |
|
| reset-selected-sku-on-hide | 窗口隐藏时重置已选择的sku | `Boolean` | `false` | - |
|
||||||
| disable-stepper-input | 是否禁用sku中stepper的input框 | `Boolean` | `false` | - |
|
| disable-stepper-input | 是否禁用sku中stepper的input框 | `Boolean` | `false` | - |
|
||||||
|
| close-on-click-overlay | 点击popup的overlay后是否关闭弹窗 | `Boolean` | `false` | - |
|
||||||
| stepper-title | 数量选择组件左侧文案 | `String` | `购买数量` | - |
|
| stepper-title | 数量选择组件左侧文案 | `String` | `购买数量` | - |
|
||||||
| custom-stepper-config | 步进器相关自定义配置 | `Object` | `{}` | - |
|
| custom-stepper-config | 步进器相关自定义配置 | `Object` | `{}` | - |
|
||||||
| message-config | 留言相关配置 | `Object` | `{}` | - |
|
| message-config | 留言相关配置 | `Object` | `{}` | - |
|
||||||
|
@ -45,12 +45,34 @@ export default {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### 监听 change 事件
|
||||||
|
|
||||||
|
```html
|
||||||
|
<van-swipe @change="onChange">
|
||||||
|
<van-swipe-item>1</van-swipe-item>
|
||||||
|
<van-swipe-item>2</van-swipe-item>
|
||||||
|
<van-swipe-item>3</van-swipe-item>
|
||||||
|
<van-swipe-item>4</van-swipe-item>
|
||||||
|
</van-swipe>
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
export default {
|
||||||
|
methods: {
|
||||||
|
onChange(index) {
|
||||||
|
Toast('当前 Swipe 索引:' + index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### API
|
### API
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
||||||
|-----------|-----------|-----------|-------------|-------------|
|
|-----------|-----------|-----------|-------------|-------------|
|
||||||
| autoplay | 自动轮播间隔,单位为 ms | `Number` | - | - |
|
| autoplay | 自动轮播间隔,单位为 ms | `Number` | - | - |
|
||||||
| duration | 动画时长,单位为 ms | `Number` | `500` | - |
|
| duration | 动画时长,单位为 ms | `Number` | `500` | - |
|
||||||
|
| loop | 是否开启循环播放 | `Boolean` | `true` | - |
|
||||||
| show-indicators | 是否显示指示器 | `Boolean` | `true` | - |
|
| show-indicators | 是否显示指示器 | `Boolean` | `true` | - |
|
||||||
| initial-swipe | 初始位置,从 0 开始算 | `Number` | `0` | - |
|
| initial-swipe | 初始位置,从 0 开始算 | `Number` | `0` | - |
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ export default {
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
base() {
|
base() {
|
||||||
return `/${this.$vantLang}/component`;
|
return `/${this.$vantLang}`;
|
||||||
},
|
},
|
||||||
|
|
||||||
config() {
|
config() {
|
||||||
|
@ -2,11 +2,9 @@
|
|||||||
<div>
|
<div>
|
||||||
<van-nav-bar
|
<van-nav-bar
|
||||||
v-show="title"
|
v-show="title"
|
||||||
fixed
|
|
||||||
class="van-doc-nav-bar"
|
class="van-doc-nav-bar"
|
||||||
:title="title"
|
:title="title"
|
||||||
left-arrow
|
left-arrow
|
||||||
:left-text="$t('back')"
|
|
||||||
@click-left="onBack"
|
@click-left="onBack"
|
||||||
/>
|
/>
|
||||||
<router-view />
|
<router-view />
|
||||||
@ -14,13 +12,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { camelize } from 'packages/utils';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
title() {
|
title() {
|
||||||
const name = this.$route.name;
|
const { name } = this.$route.meta;
|
||||||
return name ? camelize(name.split('/').pop()) : '';
|
return name ? name.replace(/-/g, '') : '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -43,11 +39,8 @@ body {
|
|||||||
|
|
||||||
.van-doc-nav-bar {
|
.van-doc-nav-bar {
|
||||||
.van-nav-bar__title {
|
.van-nav-bar__title {
|
||||||
|
font-size: 15px;
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.van-doc-demo-section {
|
|
||||||
padding-top: 46px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<h2 class="zanui-desc">{{ description }}</h2>
|
<h2 class="zanui-desc">{{ description }}</h2>
|
||||||
<div class="mobile-navs">
|
<div class="mobile-navs">
|
||||||
<div class="mobile-nav-item" v-for="(item, index) in navList" v-if="item.showInMobile" :key="index">
|
<div class="mobile-nav-item" v-for="(item, index) in navList" v-if="item.showInMobile" :key="index">
|
||||||
<mobile-nav v-for="(group, index) in item.groups" :group="group" :base="base" :nav-key="index" :key="index" />
|
<mobile-nav v-for="(group, index) in item.groups" :group="group" :base="$vantLang" :nav-key="index" :key="index" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -34,10 +34,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
base() {
|
|
||||||
return `${this.$vantLang}/component`;
|
|
||||||
},
|
|
||||||
|
|
||||||
navList() {
|
navList() {
|
||||||
return this.docConfig[this.$vantLang].nav || [];
|
return this.docConfig[this.$vantLang].nav || [];
|
||||||
},
|
},
|
||||||
@ -64,8 +60,6 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 60px 15px 20px;
|
padding: 60px 15px 20px;
|
||||||
position: relative;
|
|
||||||
z-index: 1;
|
|
||||||
|
|
||||||
.zanui-title,
|
.zanui-title,
|
||||||
.zanui-desc {
|
.zanui-desc {
|
||||||
|
@ -37,6 +37,10 @@ module.exports = {
|
|||||||
title: '更新日志',
|
title: '更新日志',
|
||||||
noExample: true
|
noExample: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/built-in-style',
|
||||||
|
title: '内置样式'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/theme',
|
path: '/theme',
|
||||||
title: '定制主题',
|
title: '定制主题',
|
||||||
@ -124,10 +128,6 @@ module.exports = {
|
|||||||
path: '/progress',
|
path: '/progress',
|
||||||
title: 'Progress - 进度条'
|
title: 'Progress - 进度条'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/search',
|
|
||||||
title: 'Search - 搜索'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/stepper',
|
path: '/stepper',
|
||||||
title: 'Stepper - 步进器'
|
title: 'Stepper - 步进器'
|
||||||
@ -181,6 +181,10 @@ module.exports = {
|
|||||||
path: '/radio',
|
path: '/radio',
|
||||||
title: 'Radio - 单选框'
|
title: 'Radio - 单选框'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/search',
|
||||||
|
title: 'Search - 搜索'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/switch',
|
path: '/switch',
|
||||||
title: 'Switch - 开关'
|
title: 'Switch - 开关'
|
||||||
@ -319,6 +323,10 @@ module.exports = {
|
|||||||
title: 'Changelog',
|
title: 'Changelog',
|
||||||
noExample: true
|
noExample: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/built-in-style',
|
||||||
|
title: 'Built-in style'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/theme',
|
path: '/theme',
|
||||||
title: 'Custom Theme',
|
title: 'Custom Theme',
|
||||||
@ -406,10 +414,6 @@ module.exports = {
|
|||||||
path: '/progress',
|
path: '/progress',
|
||||||
title: 'Progress'
|
title: 'Progress'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/search',
|
|
||||||
title: 'Search'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/stepper',
|
path: '/stepper',
|
||||||
title: 'Stepper'
|
title: 'Stepper'
|
||||||
@ -463,6 +467,10 @@ module.exports = {
|
|||||||
path: '/radio',
|
path: '/radio',
|
||||||
title: 'Radio'
|
title: 'Radio'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/search',
|
||||||
|
title: 'Search'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/switch',
|
path: '/switch',
|
||||||
title: 'Switch'
|
title: 'Switch'
|
||||||
|
@ -1,19 +1,17 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import VueRouter from 'vue-router';
|
import VueRouter from 'vue-router';
|
||||||
import App from './DocsApp';
|
import App from './DocsApp';
|
||||||
import routes from './router.config';
|
import routes from './router';
|
||||||
import VantDoc from 'vant-doc';
|
import VantDoc from 'vant-doc';
|
||||||
import isMobile from './utils/is-mobile';
|
import { isMobile } from './utils';
|
||||||
import './components/nprogress.css';
|
import './components/nprogress.css';
|
||||||
|
|
||||||
Vue.use(VueRouter).use(VantDoc);
|
Vue.use(VueRouter).use(VantDoc);
|
||||||
|
|
||||||
const routesConfig = routes();
|
|
||||||
|
|
||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
mode: 'hash',
|
mode: 'hash',
|
||||||
base: '/zanui/vant/',
|
base: '/zanui/vant/',
|
||||||
routes: routesConfig
|
routes: routes()
|
||||||
});
|
});
|
||||||
|
|
||||||
router.beforeEach((route, redirect, next) => {
|
router.beforeEach((route, redirect, next) => {
|
||||||
@ -34,5 +32,5 @@ window.vueRouter = router;
|
|||||||
new Vue({ // eslint-disable-line
|
new Vue({ // eslint-disable-line
|
||||||
render: h => h(App),
|
render: h => h(App),
|
||||||
router,
|
router,
|
||||||
el: '#app-container'
|
el: '#app'
|
||||||
});
|
});
|
||||||
|
@ -3,15 +3,16 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||||
|
<meta http-Equiv="Cache-Control" Content="no-cache" />
|
||||||
|
<meta http-Equiv="Pragma" Content="no-cache" />
|
||||||
|
<meta http-Equiv="Expires" Content="0" />
|
||||||
<link rel="shortcut icon" href="https://img.yzcdn.cn/zanui/vant/vant-2017-12-18.ico">
|
<link rel="shortcut icon" href="https://img.yzcdn.cn/zanui/vant/vant-2017-12-18.ico">
|
||||||
<title>Vant - 有赞移动端 Vue 组件库</title>
|
<title>Vant - 有赞移动端 Vue 组件库</title>
|
||||||
<script>window.Promise || document.write('<script src="//b.yzcdn.cn/huiyi/build/h5/js/pinkie.min.js"><\/script>');</script>
|
<script>window.Promise || document.write('<script src="//img.yzcdn.cn/huiyi/build/h5/js/pinkie.min.js"><\/script>');</script>
|
||||||
</head>
|
</head>
|
||||||
<body ontouchstart>
|
<body ontouchstart>
|
||||||
|
|
||||||
<div id="app-container">
|
<div id="app"></div>
|
||||||
<app></app>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import VueRouter from 'vue-router';
|
import VueRouter from 'vue-router';
|
||||||
import App from './WapApp';
|
import App from './WapApp';
|
||||||
import routes from './router.config';
|
import routes from './router';
|
||||||
import Vant, { Lazyload } from 'packages';
|
import Vant, { Lazyload } from 'packages';
|
||||||
import VantDoc from 'vant-doc';
|
import VantDoc from 'vant-doc';
|
||||||
import 'packages/vant-css/src/index.css';
|
import 'packages/vant-css/src/index.css';
|
||||||
import 'packages/vant-css/src/icon-local.css';
|
|
||||||
import 'vant-doc/src/helper/touch-simulator';
|
import 'vant-doc/src/helper/touch-simulator';
|
||||||
import './components/nprogress.css';
|
import './components/nprogress.css';
|
||||||
|
|
||||||
@ -17,18 +16,19 @@ Vue
|
|||||||
lazyComponent: true
|
lazyComponent: true
|
||||||
});
|
});
|
||||||
|
|
||||||
const routesConfig = routes(true);
|
|
||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
mode: 'hash',
|
mode: 'hash',
|
||||||
base: '/zanui/vant/examples',
|
base: '/zanui/vant/examples',
|
||||||
routes: routesConfig
|
routes: routes(true)
|
||||||
});
|
});
|
||||||
|
|
||||||
router.afterEach(() => {
|
router.afterEach(() => {
|
||||||
if (router.currentRoute.name) {
|
if (router.currentRoute.name) {
|
||||||
window.scrollTo(0, 0);
|
window.scrollTo(0, 0);
|
||||||
}
|
}
|
||||||
|
if (!router.currentRoute.redirectedFrom) {
|
||||||
Vue.nextTick(() => window.syncPath());
|
Vue.nextTick(() => window.syncPath());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
window.vueRouter = router;
|
window.vueRouter = router;
|
||||||
@ -36,5 +36,5 @@ window.vueRouter = router;
|
|||||||
new Vue({ // eslint-disable-line
|
new Vue({ // eslint-disable-line
|
||||||
render: h => h(App),
|
render: h => h(App),
|
||||||
router,
|
router,
|
||||||
el: '#app-container'
|
el: '#app'
|
||||||
});
|
});
|
@ -22,28 +22,26 @@ const registerRoute = (isExample) => {
|
|||||||
} else {
|
} else {
|
||||||
route.push({
|
route.push({
|
||||||
path: `/${lang}`,
|
path: `/${lang}`,
|
||||||
redirect: `/${lang}/component/intro`
|
redirect: `/${lang}/intro`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const navs = docConfig[lang].nav || [];
|
const navs = docConfig[lang].nav || [];
|
||||||
navs.forEach(nav => {
|
navs.forEach(nav => {
|
||||||
if (isExample && !nav.showInMobile) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nav.groups) {
|
if (nav.groups) {
|
||||||
nav.groups.forEach(group => {
|
nav.groups.forEach(group => {
|
||||||
group.list.forEach(page => addRoute(page, lang));
|
group.list.forEach(page => addRoute(page, lang));
|
||||||
});
|
});
|
||||||
} else if (nav.children) {
|
|
||||||
nav.children.forEach(page => addRoute(page, lang));
|
|
||||||
} else {
|
} else {
|
||||||
addRoute(nav, lang);
|
addRoute(nav, lang);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function addRoute(page, lang) {
|
function addRoute(page, lang) {
|
||||||
|
if (isExample && page.noExample) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const { path } = page;
|
const { path } = page;
|
||||||
if (path) {
|
if (path) {
|
||||||
const name = lang + '/' + path.replace('/', '');
|
const name = lang + '/' + path.replace('/', '');
|
||||||
@ -58,8 +56,11 @@ const registerRoute = (isExample) => {
|
|||||||
route.push({
|
route.push({
|
||||||
name,
|
name,
|
||||||
component,
|
component,
|
||||||
path: `/${lang}/component${path}`,
|
path: `/${lang}${path}`,
|
||||||
meta: { lang }
|
meta: {
|
||||||
|
lang,
|
||||||
|
name: page.title
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,9 +2,8 @@
|
|||||||
* 同步父窗口和 iframe 的 vue-router 状态
|
* 同步父窗口和 iframe 的 vue-router 状态
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import isMobile from './is-mobile';
|
|
||||||
import { setLang } from './lang';
|
import { setLang } from './lang';
|
||||||
import { iframeReady } from './iframe';
|
import { iframeReady, isMobile } from './';
|
||||||
|
|
||||||
window.syncPath = function(dir) {
|
window.syncPath = function(dir) {
|
||||||
const router = window.vueRouter;
|
const router = window.vueRouter;
|
||||||
@ -23,6 +22,7 @@ window.syncPath = function(dir) {
|
|||||||
iframe.contentWindow.changePath(lang, currentDir);
|
iframe.contentWindow.changePath(lang, currentDir);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
setLang(lang);
|
||||||
} else if (isInIframe) {
|
} else if (isInIframe) {
|
||||||
window.top.changePath(lang, currentDir);
|
window.top.changePath(lang, currentDir);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export function iframeReady(iframe, callback) {
|
function iframeReady(iframe, callback) {
|
||||||
const doc = iframe.contentDocument || iframe.contentWindow.document;
|
const doc = iframe.contentDocument || iframe.contentWindow.document;
|
||||||
const interval = () => {
|
const interval = () => {
|
||||||
if (iframe.contentWindow.changePath) {
|
if (iframe.contentWindow.changePath) {
|
||||||
@ -16,3 +16,11 @@ export function iframeReady(iframe, callback) {
|
|||||||
iframe.onload = interval;
|
iframe.onload = interval;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ua = navigator.userAgent.toLowerCase();
|
||||||
|
const isMobile = /ios|iphone|ipod|ipad|android/.test(ua);
|
||||||
|
|
||||||
|
export {
|
||||||
|
isMobile,
|
||||||
|
iframeReady
|
||||||
|
};
|
@ -1,7 +0,0 @@
|
|||||||
const isMobile = (function() {
|
|
||||||
var platform = navigator.userAgent.toLowerCase();
|
|
||||||
return (/(android|bb\d+|meego).+mobile|kdtunion|weibo|m2oapp|micromessenger|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i).test(platform) ||
|
|
||||||
(/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i).test(platform.substr(0, 4));
|
|
||||||
})();
|
|
||||||
|
|
||||||
export default isMobile;
|
|
15486
package-lock.json
generated
15486
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
47
package.json
47
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vant",
|
"name": "vant",
|
||||||
"version": "0.12.9",
|
"version": "0.12.12",
|
||||||
"description": "A Vue.js 2.0 Mobile UI at YouZan",
|
"description": "A Vue.js 2.0 Mobile UI at YouZan",
|
||||||
"main": "lib/vant.js",
|
"main": "lib/vant.js",
|
||||||
"style": "lib/vant-css/index.css",
|
"style": "lib/vant-css/index.css",
|
||||||
@ -25,10 +25,10 @@
|
|||||||
"deploy:docs": "rimraf docs/dist && cross-env NODE_ENV=production webpack --progress --hide-modules --config build/webpack.config.prod.js",
|
"deploy:docs": "rimraf docs/dist && cross-env NODE_ENV=production webpack --progress --hide-modules --config build/webpack.config.prod.js",
|
||||||
"dist": "npm run bootstrap && node build/bin/build-lib.js",
|
"dist": "npm run bootstrap && node build/bin/build-lib.js",
|
||||||
"lint": "./node_modules/.bin/eslint ./packages --ext .js,.vue",
|
"lint": "./node_modules/.bin/eslint ./packages --ext .js,.vue",
|
||||||
"test": "karma start test/unit/karma.conf.js --single-run",
|
"test": "karma start test/karma.conf.js --single-run",
|
||||||
"test:coverage": "open test/unit/coverage/lcov-report/index.html",
|
"test:coverage": "open test/coverage/lcov-report/index.html",
|
||||||
"test:watch": "karma start test/unit/karma.conf.js",
|
"test:watch": "karma start test/karma.conf.js",
|
||||||
"test:single": "node ./test/unit/selector.js",
|
"test:single": "node ./test/selector.js",
|
||||||
"release": "sh build/release.sh"
|
"release": "sh build/release.sh"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
@ -44,34 +44,34 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"babel-runtime": "6.x",
|
"babel-runtime": "6.x",
|
||||||
"vue-lazyload": "^1.1.4"
|
"vue-lazyload": "^1.2.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"vue": ">= 2.5.0"
|
"vue": ">= 2.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"autoprefixer": "^7.2.5",
|
"autoprefixer": "^8.1.0",
|
||||||
"avoriaz": "2.0.0",
|
"avoriaz": "2.0.0",
|
||||||
"babel-cli": "^6.26.0",
|
"babel-cli": "^6.26.0",
|
||||||
"babel-core": "^6.26.0",
|
"babel-core": "^6.26.0",
|
||||||
"babel-loader": "^7.1.2",
|
"babel-loader": "^7.1.3",
|
||||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||||
"babel-plugin-transform-runtime": "^6.15.0",
|
"babel-plugin-transform-runtime": "^6.15.0",
|
||||||
"babel-polyfill": "^6.26.0",
|
"babel-polyfill": "^6.26.0",
|
||||||
"babel-preset-env": "^1.6.1",
|
"babel-preset-env": "^1.6.1",
|
||||||
"cache-loader": "^1.2.0",
|
"cache-loader": "^1.2.2",
|
||||||
"chai": "^4.1.2",
|
"chai": "^4.1.2",
|
||||||
"codecov": "^3.0.0",
|
"codecov": "^3.0.0",
|
||||||
"cross-env": "^5.1.3",
|
"cross-env": "^5.1.3",
|
||||||
"css-loader": "^0.28.9",
|
"css-loader": "^0.28.10",
|
||||||
"dependency-tree": "^6.0.0",
|
"dependency-tree": "^6.0.1",
|
||||||
"eslint": "^4.17.0",
|
"eslint": "^4.18.2",
|
||||||
"eslint-plugin-vue": "^4.2.2",
|
"eslint-plugin-vue": "^4.3.0",
|
||||||
"extract-text-webpack-plugin": "3.0.2",
|
"extract-text-webpack-plugin": "3.0.2",
|
||||||
"fast-vue-md-loader": "^1.0.3",
|
"fast-vue-md-loader": "^1.0.3",
|
||||||
"friendly-errors-webpack-plugin": "^1.6.1",
|
"friendly-errors-webpack-plugin": "^1.6.1",
|
||||||
"gh-pages": "^1.0.0",
|
"gh-pages": "^1.0.0",
|
||||||
"html-webpack-plugin": "^2.29.0",
|
"html-webpack-plugin": "^3.0.4",
|
||||||
"isparta-loader": "^2.0.0",
|
"isparta-loader": "^2.0.0",
|
||||||
"karma": "^1.7.1",
|
"karma": "^1.7.1",
|
||||||
"karma-chrome-launcher": "^2.2.0",
|
"karma-chrome-launcher": "^2.2.0",
|
||||||
@ -82,30 +82,29 @@
|
|||||||
"karma-spec-reporter": "^0.0.32",
|
"karma-spec-reporter": "^0.0.32",
|
||||||
"karma-webpack": "^2.0.9",
|
"karma-webpack": "^2.0.9",
|
||||||
"mocha": "^4.0.1",
|
"mocha": "^4.0.1",
|
||||||
"postcss": "^6.0.17",
|
"postcss": "^6.0.19",
|
||||||
"postcss-calc": "^6.0.0",
|
"postcss-calc": "^6.0.0",
|
||||||
"postcss-easy-import": "^3.0.0",
|
"postcss-easy-import": "^3.0.0",
|
||||||
"postcss-loader": "^2.0.10",
|
"postcss-loader": "^2.1.1",
|
||||||
"precss": "2.0.0",
|
"precss": "2.0.0",
|
||||||
"progress-bar-webpack-plugin": "^1.10.0",
|
"progress-bar-webpack-plugin": "^1.11.0",
|
||||||
"rimraf": "^2.5.4",
|
"rimraf": "^2.5.4",
|
||||||
"shelljs": "^0.8.1",
|
"shelljs": "^0.8.1",
|
||||||
"sinon": "^2.4.1",
|
"sinon": "^2.4.1",
|
||||||
"sinon-chai": "^2.12.0",
|
"sinon-chai": "^2.12.0",
|
||||||
"style-loader": "^0.20.1",
|
"style-loader": "^0.20.2",
|
||||||
"uppercamelcase": "^3.0.0",
|
"uppercamelcase": "^3.0.0",
|
||||||
"url-loader": "^0.6.2",
|
"url-loader": "^1.0.1",
|
||||||
"vant-doc": "1.0.3",
|
"vant-doc": "1.0.4",
|
||||||
"vue": "^2.5.13",
|
"vue": "^2.5.13",
|
||||||
"vue-loader": "^14.1.1",
|
"vue-loader": "^14.1.1",
|
||||||
"vue-router": "^3.0.1",
|
"vue-router": "^3.0.1",
|
||||||
"vue-sfc-compiler": "^0.0.8",
|
"vue-sfc-compiler": "^0.0.8",
|
||||||
"vue-style-loader": "^3.1.2",
|
"vue-style-loader": "^4.0.2",
|
||||||
"vue-template-compiler": "^2.5.13",
|
"vue-template-compiler": "^2.5.13",
|
||||||
"vue-template-es2015-compiler": "^1.6.0",
|
"vue-template-es2015-compiler": "^1.6.0",
|
||||||
"webpack": "^3.10.0",
|
"webpack": "^3.11.0",
|
||||||
"webpack-bundle-analyzer": "^2.10.0",
|
|
||||||
"webpack-dev-server": "2.11.1",
|
"webpack-dev-server": "2.11.1",
|
||||||
"webpack-merge": "^4.1.1"
|
"webpack-merge": "^4.1.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,6 +126,10 @@ export default create({
|
|||||||
searchResult: {
|
searchResult: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => []
|
||||||
|
},
|
||||||
|
telValidator: {
|
||||||
|
type: Function,
|
||||||
|
default: validateMobile
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -233,7 +237,7 @@ export default create({
|
|||||||
case 'name':
|
case 'name':
|
||||||
return value ? value.length <= 15 ? '' : $t('nameOverlimit') : $t('nameEmpty');
|
return value ? value.length <= 15 ? '' : $t('nameOverlimit') : $t('nameEmpty');
|
||||||
case 'tel':
|
case 'tel':
|
||||||
return validateMobile(value) ? '' : $t('telWrong');
|
return this.telValidator(value) ? '' : $t('telWrong');
|
||||||
case 'area_code':
|
case 'area_code':
|
||||||
return value ? +value !== -1 ? '' : $t('areaWrong') : $t('areaEmpty');
|
return value ? +value !== -1 ? '' : $t('areaWrong') : $t('areaEmpty');
|
||||||
case 'address_detail':
|
case 'address_detail':
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { create } from '../utils';
|
import { create, isObj } from '../utils';
|
||||||
import Picker from '../picker';
|
import Picker from '../picker';
|
||||||
|
|
||||||
export default create({
|
export default create({
|
||||||
@ -42,7 +42,7 @@ export default create({
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
listValid() {
|
listValid() {
|
||||||
return this.areaList && typeof this.areaList.province_list === 'object';
|
return this.areaList && isObj(this.areaList.province_list);
|
||||||
},
|
},
|
||||||
|
|
||||||
columns() {
|
columns() {
|
||||||
|
@ -12,7 +12,11 @@ export default create({
|
|||||||
|
|
||||||
props: {
|
props: {
|
||||||
value: {},
|
value: {},
|
||||||
disabled: Boolean
|
disabled: Boolean,
|
||||||
|
max: {
|
||||||
|
default: 0,
|
||||||
|
type: Number
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -1,28 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div class="van-checkbox">
|
||||||
class="van-checkbox"
|
<icon
|
||||||
|
name="success"
|
||||||
|
class="van-checkbox__icon"
|
||||||
:class="[
|
:class="[
|
||||||
`van-checkbox--${shape}`,
|
`van-checkbox--${shape}`,
|
||||||
{ 'van-checkbox--disabled': isDisabled }
|
{ 'van-checkbox--disabled': isDisabled },
|
||||||
|
{ 'van-checkbox--checked': isChecked }
|
||||||
]"
|
]"
|
||||||
>
|
@click="onClick"
|
||||||
<span class="van-checkbox__input">
|
/>
|
||||||
<input
|
<span class="van-checkbox__label" @click="onClick('label')">
|
||||||
v-model="currentValue"
|
|
||||||
type="checkbox"
|
|
||||||
class="van-checkbox__control"
|
|
||||||
:disabled="isDisabled"
|
|
||||||
>
|
|
||||||
<icon name="success" />
|
|
||||||
</span>
|
|
||||||
<span class="van-checkbox__label" @click="onClickLabel">
|
|
||||||
<slot />
|
<slot />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { create } from '../utils';
|
import { create, isDef } from '../utils';
|
||||||
import findParent from '../mixins/find-parent';
|
import findParent from '../mixins/find-parent';
|
||||||
|
|
||||||
export default create({
|
export default create({
|
||||||
@ -33,6 +28,10 @@ export default create({
|
|||||||
props: {
|
props: {
|
||||||
value: {},
|
value: {},
|
||||||
disabled: Boolean,
|
disabled: Boolean,
|
||||||
|
labelDisabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
name: [String, Number],
|
name: [String, Number],
|
||||||
shape: {
|
shape: {
|
||||||
type: String,
|
type: String,
|
||||||
@ -46,32 +45,38 @@ export default create({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
data() {
|
||||||
// whether is in van-checkbox-group
|
this.findParentByName('van-checkbox-group');
|
||||||
isGroup() {
|
return {};
|
||||||
return !!this.findParentByName('van-checkbox-group');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
currentValue: {
|
currentValue: {
|
||||||
get() {
|
get() {
|
||||||
return this.isGroup && this.parentGroup ? this.parentGroup.value.indexOf(this.name) !== -1 : this.value;
|
return this.parentGroup
|
||||||
|
? this.parentGroup.value.indexOf(this.name) !== -1
|
||||||
|
: this.value;
|
||||||
},
|
},
|
||||||
|
|
||||||
set(val) {
|
set(val) {
|
||||||
if (this.isGroup && this.parentGroup) {
|
const { parentGroup } = this;
|
||||||
|
if (parentGroup) {
|
||||||
const parentValue = this.parentGroup.value.slice();
|
const parentValue = this.parentGroup.value.slice();
|
||||||
if (val) {
|
if (val) {
|
||||||
|
if (parentGroup.max && parentValue.length >= parentGroup.max) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
/* istanbul ignore else */
|
/* istanbul ignore else */
|
||||||
if (parentValue.indexOf(this.name) === -1) {
|
if (parentValue.indexOf(this.name) === -1) {
|
||||||
parentValue.push(this.name);
|
parentValue.push(this.name);
|
||||||
this.parentGroup.$emit('input', parentValue);
|
parentGroup.$emit('input', parentValue);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const index = parentValue.indexOf(this.name);
|
const index = parentValue.indexOf(this.name);
|
||||||
/* istanbul ignore else */
|
/* istanbul ignore else */
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
parentValue.splice(index, 1);
|
parentValue.splice(index, 1);
|
||||||
this.parentGroup.$emit('input', parentValue);
|
parentGroup.$emit('input', parentValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -84,19 +89,19 @@ export default create({
|
|||||||
const { currentValue } = this;
|
const { currentValue } = this;
|
||||||
if ({}.toString.call(currentValue) === '[object Boolean]') {
|
if ({}.toString.call(currentValue) === '[object Boolean]') {
|
||||||
return currentValue;
|
return currentValue;
|
||||||
} else if (currentValue !== null && currentValue !== undefined) {
|
} else if (isDef(currentValue)) {
|
||||||
return currentValue === this.name;
|
return currentValue === this.name;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
isDisabled() {
|
isDisabled() {
|
||||||
return (this.isGroup && this.parentGroup && this.parentGroup.disabled) || this.disabled;
|
return (this.parentGroup && this.parentGroup.disabled) || this.disabled;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onClickLabel() {
|
onClick(target) {
|
||||||
if (!this.isDisabled) {
|
if (!this.isDisabled && !(target === 'label' && this.labelDisabled)) {
|
||||||
this.currentValue = !this.currentValue;
|
this.currentValue = !this.currentValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,10 @@ export default create({
|
|||||||
tel: '',
|
tel: '',
|
||||||
name: ''
|
name: ''
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
telValidator: {
|
||||||
|
type: Function,
|
||||||
|
default: validateMobile
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -84,7 +88,7 @@ export default create({
|
|||||||
case 'name':
|
case 'name':
|
||||||
return value ? value.length <= 15 ? '' : this.$t('nameOverlimit') : this.$t('nameEmpty');
|
return value ? value.length <= 15 ? '' : this.$t('nameOverlimit') : this.$t('nameEmpty');
|
||||||
case 'tel':
|
case 'tel':
|
||||||
return validateMobile(value) ? '' : this.$t('telInvalid');
|
return this.telValidator(value) ? '' : this.$t('telInvalid');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
:data="item"
|
:data="item"
|
||||||
/>
|
/>
|
||||||
<div class="van-coupon-list__empty" v-if="!coupons.length && !disabledCoupons.length">
|
<div class="van-coupon-list__empty" v-if="!coupons.length && !disabledCoupons.length">
|
||||||
<img src="https://b.yzcdn.cn/v2/image/wap/trade/new_order/empty@2x.png" >
|
<img src="https://img.yzcdn.cn/v2/image/wap/trade/new_order/empty@2x.png" >
|
||||||
<p>{{ $t('empty') }}</p>
|
<p>{{ $t('empty') }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -63,7 +63,7 @@ import TreeSelect from './tree-select';
|
|||||||
import Uploader from './uploader';
|
import Uploader from './uploader';
|
||||||
import Waterfall from './waterfall';
|
import Waterfall from './waterfall';
|
||||||
|
|
||||||
const version = '0.12.9';
|
const version = '0.12.12';
|
||||||
const components = [
|
const components = [
|
||||||
Actionsheet,
|
Actionsheet,
|
||||||
AddressEdit,
|
AddressEdit,
|
||||||
|
@ -113,7 +113,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.overlay) {
|
if (this.overlay) {
|
||||||
manager.openModal(this, {
|
manager.open(this, {
|
||||||
id: this._popupId,
|
id: this._popupId,
|
||||||
dom: this.$el,
|
dom: this.$el,
|
||||||
zIndex: context.plusKey('zIndex'),
|
zIndex: context.plusKey('zIndex'),
|
||||||
@ -146,7 +146,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
doAfterClose() {
|
doAfterClose() {
|
||||||
manager.closeModal(this._popupId);
|
manager.close(this._popupId);
|
||||||
|
|
||||||
if (this.lockOnScroll) {
|
if (this.lockOnScroll) {
|
||||||
document.body.classList.remove('van-overflow-hidden');
|
document.body.classList.remove('van-overflow-hidden');
|
||||||
|
@ -2,68 +2,48 @@ import Vue from 'vue';
|
|||||||
import Modal from './Modal';
|
import Modal from './Modal';
|
||||||
import context from './context';
|
import context from './context';
|
||||||
|
|
||||||
const modalDefaultConfig = {
|
const defaultConfig = {
|
||||||
className: '',
|
className: '',
|
||||||
customStyle: {}
|
customStyle: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
const manager = {
|
export default {
|
||||||
getModal() {
|
open(vm, config) {
|
||||||
let { modal } = context;
|
|
||||||
|
|
||||||
if (!modal) {
|
|
||||||
const ModalConstructor = Vue.extend(Modal);
|
|
||||||
modal = new ModalConstructor({
|
|
||||||
el: document.createElement('div')
|
|
||||||
});
|
|
||||||
modal.$on('click', () => {
|
|
||||||
manager.onClickOverlay();
|
|
||||||
});
|
|
||||||
|
|
||||||
context.modal = modal;
|
|
||||||
}
|
|
||||||
|
|
||||||
return modal;
|
|
||||||
},
|
|
||||||
|
|
||||||
// close popup when click modal && closeOnClickOverlay is true
|
|
||||||
onClickOverlay() {
|
|
||||||
const { top } = context;
|
|
||||||
if (top) {
|
|
||||||
const { instance } = top;
|
|
||||||
if (instance && instance.closeOnClickOverlay) {
|
|
||||||
instance.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
openModal(instance, config) {
|
|
||||||
const { id, dom } = config;
|
const { id, dom } = config;
|
||||||
const exist = context.stack.some(item => item.id === id);
|
const exist = context.stack.some(item => item.id === id);
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
if (!exist) {
|
if (!exist) {
|
||||||
const targetNode = dom && dom.parentNode && dom.parentNode.nodeType !== 11 ? dom.parentNode : document.body;
|
const targetNode = dom && dom.parentNode && dom.parentNode.nodeType !== 11 ? dom.parentNode : document.body;
|
||||||
context.stack.push({ instance, id, config, targetNode });
|
context.stack.push({ vm, id, config, targetNode });
|
||||||
this.updateModal();
|
this.update();
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
closeModal(id) {
|
close(id) {
|
||||||
const { stack } = context;
|
const { stack } = context;
|
||||||
|
|
||||||
if (stack.length) {
|
if (stack.length) {
|
||||||
if (context.top.id === id) {
|
if (context.top.id === id) {
|
||||||
stack.pop();
|
stack.pop();
|
||||||
this.updateModal();
|
this.update();
|
||||||
} else {
|
} else {
|
||||||
context.stack = stack.filter(item => item.id !== id);
|
context.stack = stack.filter(item => item.id !== id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
updateModal() {
|
update() {
|
||||||
const modal = this.getModal();
|
let { modal } = context;
|
||||||
|
|
||||||
|
if (!modal) {
|
||||||
|
modal = new (Vue.extend(Modal))({
|
||||||
|
el: document.createElement('div')
|
||||||
|
});
|
||||||
|
modal.$on('click', this.onClick);
|
||||||
|
|
||||||
|
context.modal = modal;
|
||||||
|
}
|
||||||
|
|
||||||
if (modal.$el.parentNode) {
|
if (modal.$el.parentNode) {
|
||||||
modal.visible = false;
|
modal.visible = false;
|
||||||
@ -74,12 +54,21 @@ const manager = {
|
|||||||
|
|
||||||
targetNode.appendChild(modal.$el);
|
targetNode.appendChild(modal.$el);
|
||||||
Object.assign(modal, {
|
Object.assign(modal, {
|
||||||
...modalDefaultConfig,
|
...defaultConfig,
|
||||||
...config,
|
...config,
|
||||||
visible: true
|
visible: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// close popup when click modal && closeOnClickOverlay is true
|
||||||
|
onClick() {
|
||||||
|
if (context.top) {
|
||||||
|
const { vm } = context.top;
|
||||||
|
if (vm) {
|
||||||
|
vm.$emit('click-overlay');
|
||||||
|
vm.closeOnClickOverlay && vm.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default manager;
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { create } from '../utils';
|
import { create, isObj } from '../utils';
|
||||||
|
|
||||||
const DEFAULT_DURATION = 200;
|
const DEFAULT_DURATION = 200;
|
||||||
const range = (num, arr) => Math.min(Math.max(num, arr[0]), arr[1]);
|
const range = (num, arr) => Math.min(Math.max(num, arr[0]), arr[1]);
|
||||||
@ -147,11 +147,11 @@ export default create({
|
|||||||
},
|
},
|
||||||
|
|
||||||
isDisabled(option) {
|
isDisabled(option) {
|
||||||
return typeof option === 'object' && option.disabled;
|
return isObj(option) && option.disabled;
|
||||||
},
|
},
|
||||||
|
|
||||||
getOptionText(option) {
|
getOptionText(option) {
|
||||||
return typeof option === 'object' && this.valueKey in option ? option[this.valueKey] : option;
|
return isObj(option) && this.valueKey in option ? option[this.valueKey] : option;
|
||||||
},
|
},
|
||||||
|
|
||||||
setIndex(index, userAction) {
|
setIndex(index, userAction) {
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
position="bottom"
|
position="bottom"
|
||||||
lock-on-scroll
|
lock-on-scroll
|
||||||
prevent-scroll
|
prevent-scroll
|
||||||
|
:close-on-click-overlay="closeOnClickOverlay"
|
||||||
:get-container="getContainer"
|
:get-container="getContainer"
|
||||||
>
|
>
|
||||||
<div class="van-sku-container">
|
<div class="van-sku-container">
|
||||||
@ -145,6 +146,7 @@ export default create({
|
|||||||
resetStepperOnHide: Boolean,
|
resetStepperOnHide: Boolean,
|
||||||
resetSelectedSkuOnHide: Boolean,
|
resetSelectedSkuOnHide: Boolean,
|
||||||
disableStepperInput: Boolean,
|
disableStepperInput: Boolean,
|
||||||
|
closeOnClickOverlay: Boolean,
|
||||||
initialSku: {
|
initialSku: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({})
|
default: () => ({})
|
||||||
|
@ -79,11 +79,13 @@ export default create({
|
|||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
value(val) {
|
value(val) {
|
||||||
|
if (val !== '') {
|
||||||
val = this.correctValue(+val);
|
val = this.correctValue(+val);
|
||||||
if (val !== this.currentValue) {
|
if (val !== this.currentValue) {
|
||||||
this.currentValue = val;
|
this.currentValue = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@ -99,8 +101,8 @@ export default create({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onInput(event) {
|
onInput(event) {
|
||||||
const val = +event.target.value;
|
const { value } = event.target;
|
||||||
this.currentValue = this.correctValue(val);
|
this.currentValue = value ? this.correctValue(+value) : value;
|
||||||
this.emitInput();
|
this.emitInput();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -29,6 +29,10 @@ export default create({
|
|||||||
|
|
||||||
props: {
|
props: {
|
||||||
autoplay: Number,
|
autoplay: Number,
|
||||||
|
loop: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
initialSwipe: {
|
initialSwipe: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
@ -72,6 +76,12 @@ export default create({
|
|||||||
|
|
||||||
initialSwipe() {
|
initialSwipe() {
|
||||||
this.initialize();
|
this.initialize();
|
||||||
|
},
|
||||||
|
|
||||||
|
autoplay(autoplay) {
|
||||||
|
if (!autoplay) {
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -146,6 +156,14 @@ export default create({
|
|||||||
move(move = 0, offset = 0) {
|
move(move = 0, offset = 0) {
|
||||||
const { active, count, swipes, deltaX, width } = this;
|
const { active, count, swipes, deltaX, width } = this;
|
||||||
|
|
||||||
|
if (
|
||||||
|
!this.loop &&
|
||||||
|
((active === 0 && (offset > 0 || move < 0)) ||
|
||||||
|
(active === count - 1 && (offset < 0 || move > 0)))
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (move) {
|
if (move) {
|
||||||
if (active === -1) {
|
if (active === -1) {
|
||||||
swipes[count - 1].offset = 0;
|
swipes[count - 1].offset = 0;
|
||||||
@ -184,9 +202,9 @@ export default create({
|
|||||||
},
|
},
|
||||||
|
|
||||||
getDirection(touch) {
|
getDirection(touch) {
|
||||||
const distanceX = Math.abs(touch.clientX - this.startX);
|
const offsetX = Math.abs(touch.clientX - this.startX);
|
||||||
const distanceY = Math.abs(touch.clientY - this.startY);
|
const offsetY = Math.abs(touch.clientY - this.startY);
|
||||||
return distanceX > distanceY ? 'horizontal' : distanceX < distanceY ? 'vertical' : '';
|
return offsetX > offsetY ? 'horizontal' : offsetX < offsetY ? 'vertical' : '';
|
||||||
},
|
},
|
||||||
|
|
||||||
range(num, arr) {
|
range(num, arr) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<cell :title="title" class="van-switch-cell">
|
<cell :title="title" :border="border" class="van-switch-cell">
|
||||||
<van-switch v-bind="$props" @input="$emit('input', $event)" />
|
<van-switch v-bind="$props" @input="$emit('input', $event)" />
|
||||||
</cell>
|
</cell>
|
||||||
</template>
|
</template>
|
||||||
@ -20,6 +20,7 @@ export default create({
|
|||||||
props: {
|
props: {
|
||||||
title: String,
|
title: String,
|
||||||
value: Boolean,
|
value: Boolean,
|
||||||
|
border: Boolean,
|
||||||
loading: Boolean,
|
loading: Boolean,
|
||||||
disabled: Boolean
|
disabled: Boolean
|
||||||
},
|
},
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import VueToast from './toast';
|
import VueToast from './toast';
|
||||||
|
import { isObj } from '../utils';
|
||||||
|
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
@ -10,7 +11,7 @@ const defaultOptions = {
|
|||||||
position: 'middle',
|
position: 'middle',
|
||||||
forbidClick: false
|
forbidClick: false
|
||||||
};
|
};
|
||||||
const parseOptions = message => typeof message === 'object' ? message : { message };
|
const parseOptions = message => isObj(message) ? message : { message };
|
||||||
|
|
||||||
let queue = [];
|
let queue = [];
|
||||||
let singleton = true;
|
let singleton = true;
|
||||||
|
@ -8,10 +8,10 @@ import install from './install';
|
|||||||
import Loading from '../loading';
|
import Loading from '../loading';
|
||||||
|
|
||||||
export default function(sfc) {
|
export default function(sfc) {
|
||||||
sfc.mixins = sfc.mixins || [];
|
|
||||||
sfc.components = sfc.components || {};
|
|
||||||
sfc.install = sfc.install || install;
|
sfc.install = sfc.install || install;
|
||||||
|
sfc.mixins = sfc.mixins || [];
|
||||||
sfc.mixins.push(i18n);
|
sfc.mixins.push(i18n);
|
||||||
|
sfc.components = sfc.components || {};
|
||||||
sfc.components.icon = Icon;
|
sfc.components.icon = Icon;
|
||||||
sfc.components.loading = Loading;
|
sfc.components.loading = Loading;
|
||||||
|
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
import { isDef } from './';
|
import { isDef, isObj } from './';
|
||||||
|
|
||||||
const { hasOwnProperty } = Object.prototype;
|
const { hasOwnProperty } = Object.prototype;
|
||||||
|
|
||||||
function isObj(x) {
|
|
||||||
const type = typeof x;
|
|
||||||
return x !== null && (type === 'object' || type === 'function');
|
|
||||||
}
|
|
||||||
|
|
||||||
function assignKey(to, from, key) {
|
function assignKey(to, from, key) {
|
||||||
const val = from[key];
|
const val = from[key];
|
||||||
|
|
||||||
|
@ -7,6 +7,11 @@ function isDef(value) {
|
|||||||
return value !== undefined && value !== null;
|
return value !== undefined && value !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isObj(x) {
|
||||||
|
const type = typeof x;
|
||||||
|
return x !== null && (type === 'object' || type === 'function');
|
||||||
|
}
|
||||||
|
|
||||||
function get(object, path) {
|
function get(object, path) {
|
||||||
const keys = path.split('.');
|
const keys = path.split('.');
|
||||||
let result = object;
|
let result = object;
|
||||||
@ -30,6 +35,7 @@ function isAndroid() {
|
|||||||
|
|
||||||
export {
|
export {
|
||||||
get,
|
get,
|
||||||
|
isObj,
|
||||||
isDef,
|
isDef,
|
||||||
create,
|
create,
|
||||||
isServer,
|
isServer,
|
||||||
|
Binary file not shown.
2
packages/vant-css/package-lock.json
generated
2
packages/vant-css/package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vant-css",
|
"name": "vant-css",
|
||||||
"version": "0.12.10",
|
"version": "0.12.12",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vant-css",
|
"name": "vant-css",
|
||||||
"version": "0.12.10",
|
"version": "0.12.12",
|
||||||
"description": "vant css.",
|
"description": "vant css.",
|
||||||
"main": "lib/index.css",
|
"main": "lib/index.css",
|
||||||
"style": "lib/index.css",
|
"style": "lib/index.css",
|
||||||
|
@ -49,6 +49,10 @@ module.exports = {
|
|||||||
src: 'more-o.svg',
|
src: 'more-o.svg',
|
||||||
css: 'more-o'
|
css: 'more-o'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
src: 'info-o.svg',
|
||||||
|
css: 'info-o'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
src: 'share.svg',
|
src: 'share.svg',
|
||||||
css: 'share'
|
css: 'share'
|
||||||
@ -205,6 +209,10 @@ module.exports = {
|
|||||||
src: 'arrow-left.svg',
|
src: 'arrow-left.svg',
|
||||||
css: 'arrow-left'
|
css: 'arrow-left'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
src: '搜索.svg',
|
||||||
|
css: 'search'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
src: '成功.svg',
|
src: '成功.svg',
|
||||||
css: 'success'
|
css: 'success'
|
||||||
@ -218,9 +226,25 @@ module.exports = {
|
|||||||
css: 'add'
|
css: 'add'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: '选中.svg',
|
src: 'checked.svg',
|
||||||
css: 'checked'
|
css: 'checked'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
src: 'warn.svg',
|
||||||
|
css: 'warn'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: '清除搜索.svg',
|
||||||
|
css: 'clear'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: 'underway.svg',
|
||||||
|
css: 'underway'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: 'more.svg',
|
||||||
|
css: 'more'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
src: '喜欢2.svg',
|
src: '喜欢2.svg',
|
||||||
css: 'like'
|
css: 'like'
|
||||||
@ -245,14 +269,6 @@ module.exports = {
|
|||||||
src: '照片.svg',
|
src: '照片.svg',
|
||||||
css: 'photo'
|
css: 'photo'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
src: '搜索.svg',
|
|
||||||
css: 'search'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
src: '清除搜索.svg',
|
|
||||||
css: 'clear'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
src: '微信支付.svg',
|
src: '微信支付.svg',
|
||||||
css: 'wechat'
|
css: 'wechat'
|
||||||
@ -329,10 +345,6 @@ module.exports = {
|
|||||||
src: '货到付款.svg',
|
src: '货到付款.svg',
|
||||||
css: 'cash-on-deliver'
|
css: 'cash-on-deliver'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
src: '进行中.svg',
|
|
||||||
css: 'underway'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
src: '电话.svg',
|
src: '电话.svg',
|
||||||
css: 'phone'
|
css: 'phone'
|
||||||
@ -368,10 +380,6 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
src: '热卖.svg',
|
src: '热卖.svg',
|
||||||
css: 'hot-sale'
|
css: 'hot-sale'
|
||||||
},
|
|
||||||
{
|
|
||||||
src: 'more.svg',
|
|
||||||
css: 'more'
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-family: '<%= fontName %>';
|
font-family: '<%= fontName %>';
|
||||||
src: url('https://b.yzcdn.cn/zanui/icon/<%= fontName %>.ttf') format('truetype');
|
src: url('https://img.yzcdn.cn/zanui/icon/<%= fontName %>.ttf') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
.van-icon {
|
.van-icon {
|
||||||
|
@ -69,6 +69,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&--loading {
|
&--loading {
|
||||||
|
.van-loading {
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
.van-button__text {
|
.van-button__text {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -6,70 +6,45 @@ $van-checkbox-size: 20px;
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
.van-icon-success {
|
&__icon,
|
||||||
color: $white;
|
&__label {
|
||||||
display: block;
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
line-height: $van-checkbox-size;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__icon {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
color: transparent;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
pointer-events: none;
|
|
||||||
border: 1px solid #aaa;
|
border: 1px solid #aaa;
|
||||||
width: $van-checkbox-size;
|
width: $van-checkbox-size;
|
||||||
height: $van-checkbox-size;
|
height: $van-checkbox-size;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
&::before {
|
|
||||||
margin: 0 auto;
|
|
||||||
line-height: $van-checkbox-size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__input,
|
|
||||||
&__label {
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__input {
|
|
||||||
position: relative;
|
|
||||||
height: $van-checkbox-size;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__control {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
opacity: 0;
|
|
||||||
margin: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&__label {
|
&__label {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
line-height: $van-checkbox-size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&--round {
|
&--round {
|
||||||
.van-icon-success {
|
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
&__control:checked + .van-icon-success {
|
&--checked {
|
||||||
|
color: #fff;
|
||||||
border-color: $green;
|
border-color: $green;
|
||||||
background-color: $green;
|
background-color: $green;
|
||||||
}
|
}
|
||||||
|
|
||||||
&--disabled {
|
&--disabled {
|
||||||
.van-icon-success {
|
|
||||||
color: $background-color;
|
color: $background-color;
|
||||||
border-color: $gray-light;
|
border-color: $gray-light;
|
||||||
background-color: currentColor;
|
background-color: currentColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.van-checkbox__control:checked + .van-icon-success {
|
&--disabled&--checked {
|
||||||
border-color: $gray-light;
|
border-color: $gray-light;
|
||||||
background-color: $gray-light;
|
background-color: $gray-light;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,14 @@
|
|||||||
@import "../mixins/border-retina.css";
|
@import "../mixins/border-retina.css";
|
||||||
|
|
||||||
.van-hairline {
|
[class*='van-hairline'] {
|
||||||
&,
|
|
||||||
&--top,
|
|
||||||
&--left,
|
|
||||||
&--right,
|
|
||||||
&--bottom,
|
|
||||||
&--top-bottom,
|
|
||||||
&--surround {
|
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
@mixin hairline;
|
@mixin hairline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.van-hairline {
|
||||||
&--top::after {
|
&--top::after {
|
||||||
border-top-width: 1px;
|
border-top-width: 1px;
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
margin-left: -1px; /* hack for flex space */
|
margin-left: -1px; /* hack for flex space */
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding-right: 16px;
|
margin-left: -16px;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
background-image: linear-gradient(45deg, #ff6868, #ff8c8c);
|
background-image: linear-gradient(45deg, #ff6868, #ff8c8c);
|
||||||
@ -158,7 +158,6 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
max-width: 90px;
|
|
||||||
@mixin ellipsis;
|
@mixin ellipsis;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,9 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
resize: none;
|
resize: none;
|
||||||
|
|
||||||
&[disabled] {
|
&:disabled {
|
||||||
|
opacity: 1;
|
||||||
|
color: $gray-darker;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-family: 'vant-icon';
|
font-family: 'vant-icon';
|
||||||
src: url('./vant-icon-dc7d92.ttf') format('truetype');
|
src: url('./vant-icon-4c3245.ttf') format('truetype');
|
||||||
}
|
}
|
@ -4,7 +4,7 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-family: 'vant-icon';
|
font-family: 'vant-icon';
|
||||||
src: url('https://b.yzcdn.cn/zanui/icon/vant-icon-dc7d92.ttf') format('truetype');
|
src: url('https://img.yzcdn.cn/zanui/icon/vant-icon-4c3245.ttf') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
.van-icon {
|
.van-icon {
|
||||||
@ -171,147 +171,153 @@
|
|||||||
.van-icon-hot:before {
|
.van-icon-hot:before {
|
||||||
content: "\F02C";
|
content: "\F02C";
|
||||||
}
|
}
|
||||||
.van-icon-like-o:before {
|
.van-icon-info-o:before {
|
||||||
content: "\F02D";
|
content: "\F02D";
|
||||||
}
|
}
|
||||||
.van-icon-like:before {
|
.van-icon-like-o:before {
|
||||||
content: "\F02E";
|
content: "\F02E";
|
||||||
}
|
}
|
||||||
.van-icon-location:before {
|
.van-icon-like:before {
|
||||||
content: "\F02F";
|
content: "\F02F";
|
||||||
}
|
}
|
||||||
.van-icon-logistics:before {
|
.van-icon-location:before {
|
||||||
content: "\F030";
|
content: "\F030";
|
||||||
}
|
}
|
||||||
.van-icon-member-day-privilege:before {
|
.van-icon-logistics:before {
|
||||||
content: "\F031";
|
content: "\F031";
|
||||||
}
|
}
|
||||||
.van-icon-more-o:before {
|
.van-icon-member-day-privilege:before {
|
||||||
content: "\F032";
|
content: "\F032";
|
||||||
}
|
}
|
||||||
.van-icon-more:before {
|
.van-icon-more-o:before {
|
||||||
content: "\F033";
|
content: "\F033";
|
||||||
}
|
}
|
||||||
.van-icon-new-arrival:before {
|
.van-icon-more:before {
|
||||||
content: "\F034";
|
content: "\F034";
|
||||||
}
|
}
|
||||||
.van-icon-new:before {
|
.van-icon-new-arrival:before {
|
||||||
content: "\F035";
|
content: "\F035";
|
||||||
}
|
}
|
||||||
.van-icon-other-pay:before {
|
.van-icon-new:before {
|
||||||
content: "\F036";
|
content: "\F036";
|
||||||
}
|
}
|
||||||
.van-icon-passed:before {
|
.van-icon-other-pay:before {
|
||||||
content: "\F037";
|
content: "\F037";
|
||||||
}
|
}
|
||||||
.van-icon-password-not-view:before {
|
.van-icon-passed:before {
|
||||||
content: "\F038";
|
content: "\F038";
|
||||||
}
|
}
|
||||||
.van-icon-password-view:before {
|
.van-icon-password-not-view:before {
|
||||||
content: "\F039";
|
content: "\F039";
|
||||||
}
|
}
|
||||||
.van-icon-pause:before {
|
.van-icon-password-view:before {
|
||||||
content: "\F03A";
|
content: "\F03A";
|
||||||
}
|
}
|
||||||
.van-icon-peer-pay:before {
|
.van-icon-pause:before {
|
||||||
content: "\F03B";
|
content: "\F03B";
|
||||||
}
|
}
|
||||||
.van-icon-pending-deliver:before {
|
.van-icon-peer-pay:before {
|
||||||
content: "\F03C";
|
content: "\F03C";
|
||||||
}
|
}
|
||||||
.van-icon-pending-evaluate:before {
|
.van-icon-pending-deliver:before {
|
||||||
content: "\F03D";
|
content: "\F03D";
|
||||||
}
|
}
|
||||||
.van-icon-pending-orders:before {
|
.van-icon-pending-evaluate:before {
|
||||||
content: "\F03E";
|
content: "\F03E";
|
||||||
}
|
}
|
||||||
.van-icon-pending-payment:before {
|
.van-icon-pending-orders:before {
|
||||||
content: "\F03F";
|
content: "\F03F";
|
||||||
}
|
}
|
||||||
.van-icon-phone:before {
|
.van-icon-pending-payment:before {
|
||||||
content: "\F040";
|
content: "\F040";
|
||||||
}
|
}
|
||||||
.van-icon-photo:before {
|
.van-icon-phone:before {
|
||||||
content: "\F041";
|
content: "\F041";
|
||||||
}
|
}
|
||||||
.van-icon-photograph:before {
|
.van-icon-photo:before {
|
||||||
content: "\F042";
|
content: "\F042";
|
||||||
}
|
}
|
||||||
.van-icon-play:before {
|
.van-icon-photograph:before {
|
||||||
content: "\F043";
|
content: "\F043";
|
||||||
}
|
}
|
||||||
.van-icon-point-gift:before {
|
.van-icon-play:before {
|
||||||
content: "\F044";
|
content: "\F044";
|
||||||
}
|
}
|
||||||
.van-icon-points-mall:before {
|
.van-icon-point-gift:before {
|
||||||
content: "\F045";
|
content: "\F045";
|
||||||
}
|
}
|
||||||
.van-icon-points:before {
|
.van-icon-points-mall:before {
|
||||||
content: "\F046";
|
content: "\F046";
|
||||||
}
|
}
|
||||||
.van-icon-qr-invalid:before {
|
.van-icon-points:before {
|
||||||
content: "\F047";
|
content: "\F047";
|
||||||
}
|
}
|
||||||
.van-icon-qr:before {
|
.van-icon-qr-invalid:before {
|
||||||
content: "\F048";
|
content: "\F048";
|
||||||
}
|
}
|
||||||
.van-icon-question:before {
|
.van-icon-qr:before {
|
||||||
content: "\F049";
|
content: "\F049";
|
||||||
}
|
}
|
||||||
.van-icon-receive-gift:before {
|
.van-icon-question:before {
|
||||||
content: "\F04A";
|
content: "\F04A";
|
||||||
}
|
}
|
||||||
.van-icon-records:before {
|
.van-icon-receive-gift:before {
|
||||||
content: "\F04B";
|
content: "\F04B";
|
||||||
}
|
}
|
||||||
.van-icon-search:before {
|
.van-icon-records:before {
|
||||||
content: "\F04C";
|
content: "\F04C";
|
||||||
}
|
}
|
||||||
.van-icon-send-gift:before {
|
.van-icon-search:before {
|
||||||
content: "\F04D";
|
content: "\F04D";
|
||||||
}
|
}
|
||||||
.van-icon-setting:before {
|
.van-icon-send-gift:before {
|
||||||
content: "\F04E";
|
content: "\F04E";
|
||||||
}
|
}
|
||||||
.van-icon-share:before {
|
.van-icon-setting:before {
|
||||||
content: "\F04F";
|
content: "\F04F";
|
||||||
}
|
}
|
||||||
.van-icon-shop-collect:before {
|
.van-icon-share:before {
|
||||||
content: "\F050";
|
content: "\F050";
|
||||||
}
|
}
|
||||||
.van-icon-shop:before {
|
.van-icon-shop-collect:before {
|
||||||
content: "\F051";
|
content: "\F051";
|
||||||
}
|
}
|
||||||
.van-icon-shopping-cart:before {
|
.van-icon-shop:before {
|
||||||
content: "\F052";
|
content: "\F052";
|
||||||
}
|
}
|
||||||
.van-icon-sign:before {
|
.van-icon-shopping-cart:before {
|
||||||
content: "\F053";
|
content: "\F053";
|
||||||
}
|
}
|
||||||
.van-icon-stop:before {
|
.van-icon-sign:before {
|
||||||
content: "\F054";
|
content: "\F054";
|
||||||
}
|
}
|
||||||
.van-icon-success:before {
|
.van-icon-stop:before {
|
||||||
content: "\F055";
|
content: "\F055";
|
||||||
}
|
}
|
||||||
.van-icon-tosend:before {
|
.van-icon-success:before {
|
||||||
content: "\F056";
|
content: "\F056";
|
||||||
}
|
}
|
||||||
.van-icon-underway:before {
|
.van-icon-tosend:before {
|
||||||
content: "\F057";
|
content: "\F057";
|
||||||
}
|
}
|
||||||
.van-icon-upgrade:before {
|
.van-icon-underway:before {
|
||||||
content: "\F058";
|
content: "\F058";
|
||||||
}
|
}
|
||||||
.van-icon-value-card:before {
|
.van-icon-upgrade:before {
|
||||||
content: "\F059";
|
content: "\F059";
|
||||||
}
|
}
|
||||||
.van-icon-wap-home:before {
|
.van-icon-value-card:before {
|
||||||
content: "\F05A";
|
content: "\F05A";
|
||||||
}
|
}
|
||||||
.van-icon-wap-nav:before {
|
.van-icon-wap-home:before {
|
||||||
content: "\F05B";
|
content: "\F05B";
|
||||||
}
|
}
|
||||||
.van-icon-wechat:before {
|
.van-icon-wap-nav:before {
|
||||||
content: "\F05C";
|
content: "\F05C";
|
||||||
}
|
}
|
||||||
|
.van-icon-warn:before {
|
||||||
|
content: "\F05D";
|
||||||
|
}
|
||||||
|
.van-icon-wechat:before {
|
||||||
|
content: "\F05E";
|
||||||
|
}
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.van-loading__spinner--gradient-circle {
|
.van-loading__spinner--gradient-circle {
|
||||||
background-image: url('https://b.yzcdn.cn/vant/gradient-circle-black.png');
|
background-image: url('https://img.yzcdn.cn/vant/gradient-circle-black.png');
|
||||||
}
|
}
|
||||||
|
|
||||||
.van-loading__spinner--spinner {
|
.van-loading__spinner--spinner {
|
||||||
@ -96,7 +96,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.van-loading__spinner--gradient-circle {
|
.van-loading__spinner--gradient-circle {
|
||||||
background-image: url('https://b.yzcdn.cn/vant/gradient-circle-white.png');
|
background-image: url('https://img.yzcdn.cn/vant/gradient-circle-white.png');
|
||||||
}
|
}
|
||||||
|
|
||||||
.van-loading__spinner--spinner {
|
.van-loading__spinner--spinner {
|
||||||
|
Binary file not shown.
@ -1,8 +1,6 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
plugins: [
|
plugins: [
|
||||||
require('postcss-easy-import')({
|
require('postcss-easy-import')(),
|
||||||
extensions: ['pcss', 'css']
|
|
||||||
}),
|
|
||||||
require('precss')(),
|
require('precss')(),
|
||||||
require('postcss-calc')(),
|
require('postcss-calc')(),
|
||||||
require('autoprefixer')({
|
require('autoprefixer')({
|
||||||
|
6
test/components/badge.vue
Normal file
6
test/components/badge.vue
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<template>
|
||||||
|
<van-badge-group>
|
||||||
|
<van-badge title="热销榜" info="8" />
|
||||||
|
<van-badge title="手握寿司" info="199" />
|
||||||
|
</van-badge-group>
|
||||||
|
</template>
|
22
test/components/checkbox.vue
Normal file
22
test/components/checkbox.vue
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<template>
|
||||||
|
<van-checkbox-group v-model="result" :max="max">
|
||||||
|
<van-checkbox v-for="(item, index) in list" :key="index" :name="item" :disabled="index === 2">复选框{{ item }}</van-checkbox>
|
||||||
|
</van-checkbox-group>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
list: [
|
||||||
|
'a',
|
||||||
|
'b',
|
||||||
|
'c',
|
||||||
|
'd'
|
||||||
|
],
|
||||||
|
result: ['a', 'b'],
|
||||||
|
max: 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
16
test/components/field.vue
Normal file
16
test/components/field.vue
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<template>
|
||||||
|
<van-field @click-icon="onIconClick" @blur="$emit('blur')">
|
||||||
|
<div slot="icon">icon</div>
|
||||||
|
</van-field>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
onIconClick: {
|
||||||
|
type: Function,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
16
test/components/goods-action.vue
Normal file
16
test/components/goods-action.vue
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<template>
|
||||||
|
<van-goods-action>
|
||||||
|
<van-goods-action-mini-btn icon="chat">
|
||||||
|
客服
|
||||||
|
</van-goods-action-mini-btn>
|
||||||
|
<van-goods-action-mini-btn icon="cart" url="http://www.youzan.com">
|
||||||
|
购物车
|
||||||
|
</van-goods-action-mini-btn>
|
||||||
|
<van-goods-action-big-btn>
|
||||||
|
加入购物车
|
||||||
|
</van-goods-action-big-btn>
|
||||||
|
<van-goods-action-big-btn primary url="http://www.youzan.com">
|
||||||
|
立即购买
|
||||||
|
</van-goods-action-big-btn>
|
||||||
|
</van-goods-action>
|
||||||
|
</template>
|
@ -12,15 +12,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Tab from 'packages/tab';
|
|
||||||
import Tabs from 'packages/tabs';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
|
||||||
'van-tab': Tab,
|
|
||||||
'van-tabs': Tabs
|
|
||||||
},
|
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
active: [String, Number]
|
active: [String, Number]
|
||||||
}
|
}
|
@ -5,12 +5,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import NoticeBar from 'packages/notice-bar';
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
props: {
|
||||||
[NoticeBar.name]: NoticeBar
|
speed: Number,
|
||||||
},
|
text: String,
|
||||||
props: ['speed', 'text', 'mode', 'delay']
|
mode: String,
|
||||||
|
delay: Number
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
13
test/components/number-keyboard.vue
Normal file
13
test/components/number-keyboard.vue
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
<keep-alive>
|
||||||
|
<van-number-keyboard v-if="showKeyboard" />
|
||||||
|
</keep-alive>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
showKeyboard: Boolean
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -6,15 +6,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Radio from 'packages/radio';
|
|
||||||
import RadioGroup from 'packages/radio-group';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
|
||||||
'van-radio': Radio,
|
|
||||||
'van-radio-group': RadioGroup
|
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
radio: '1'
|
radio: '1'
|
@ -11,15 +11,3 @@
|
|||||||
</van-col>
|
</van-col>
|
||||||
</van-row>
|
</van-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
import Row from 'packages/row';
|
|
||||||
import Col from 'packages/col';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
'van-row': Row,
|
|
||||||
'van-col': Col
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
@ -8,15 +8,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Steps from 'packages/steps';
|
|
||||||
import Step from 'packages/step';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
|
||||||
'van-step': Step,
|
|
||||||
'van-steps': Steps
|
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
active: 1
|
active: 1
|
@ -2,7 +2,7 @@
|
|||||||
<van-tabbar v-model="active" @change="onChange">
|
<van-tabbar v-model="active" @change="onChange">
|
||||||
<van-tabbar-item icon="shop">
|
<van-tabbar-item icon="shop">
|
||||||
<span>自定义</span>
|
<span>自定义</span>
|
||||||
<img slot="icon" :src="active === 0 ? icon.active : icon.normal" />
|
<img slot="icon" :src="active === 0 ? icon.active : icon.normal" >
|
||||||
</van-tabbar-item>
|
</van-tabbar-item>
|
||||||
<van-tabbar-item icon="chat">标签</van-tabbar-item>
|
<van-tabbar-item icon="chat">标签</van-tabbar-item>
|
||||||
<van-tabbar-item icon="chat">标签</van-tabbar-item>
|
<van-tabbar-item icon="chat">标签</van-tabbar-item>
|
||||||
@ -11,15 +11,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Tabbar from 'packages/tabbar';
|
|
||||||
import TabbarItem from 'packages/tabbar-item';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
|
||||||
[Tabbar.name]: Tabbar,
|
|
||||||
[TabbarItem.name]: TabbarItem
|
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
active: 0,
|
active: 0,
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user