[Improvement] Rebuild test system (#1051)

This commit is contained in:
neverland 2018-05-12 14:04:32 +08:00 committed by GitHub
parent 360f2f40b1
commit a55eda8891
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
185 changed files with 4989 additions and 7950 deletions

View File

@ -4,6 +4,11 @@
"env": { "env": {
"commonjs": { "commonjs": {
"presets": [["env", { "modules": "commonjs", "loose": true }]] "presets": [["env", { "modules": "commonjs", "loose": true }]]
},
"test": {
"presets": [
["env", { "targets": { "node": 8 }}]
]
} }
} }
} }

View File

@ -13,6 +13,7 @@ const compilerOption = {
extends: path.join(__dirname, '../../.babelrc') extends: path.join(__dirname, '../../.babelrc')
} }
}; };
const whiteList = ['vant-css', 'test'];
// clear dir // clear dir
fs.emptyDirSync(esDir); fs.emptyDirSync(esDir);
@ -29,8 +30,8 @@ function compile(dir, jsOnly = false) {
files.forEach(file => { files.forEach(file => {
const absolutePath = path.join(dir, file); const absolutePath = path.join(dir, file);
// 移除 vant-css // 移除不需要的文件
if (file.indexOf('vant-css') !== -1) { if (whiteList.indexOf(file) !== -1) {
fs.removeSync(absolutePath); fs.removeSync(absolutePath);
// 遍历文件夹 // 遍历文件夹
} else if (isDir(absolutePath)) { } else if (isDir(absolutePath)) {

View File

@ -95,6 +95,7 @@ export default {
disabledDiscountCoupon() { disabledDiscountCoupon() {
return { return {
...this.discountCoupon, ...this.discountCoupon,
discount: 10,
id: 4, id: 4,
available: 0, available: 0,
reason: this.$t('coupon.reason') reason: this.$t('coupon.reason')

View File

@ -15,7 +15,7 @@
</template> </template>
<script> <script>
import { ImagePreview } from 'packages'; import { ImagePreview } from '../../../packages';
export default { export default {
i18n: { i18n: {

View File

@ -18,6 +18,10 @@
</demo-section> </demo-section>
</template> </template>
<script>
export default {};
</script>
<style lang="postcss"> <style lang="postcss">
.demo-panel { .demo-panel {
.van-panel__footer { .van-panel__footer {

View File

@ -30,7 +30,7 @@ export default {
data() { data() {
return { return {
value: '', value: '123',
showKeyboard: true showKeyboard: true
}; };
}, },

View File

@ -76,7 +76,7 @@ export default {
data() { data() {
return { return {
active: 0 active: 1
}; };
}, },

View File

@ -14,7 +14,7 @@
</template> </template>
<script> <script>
import { Waterfall } from 'packages'; import { Waterfall } from '../../../packages';
export default { export default {
i18n: { i18n: {

View File

@ -33,7 +33,7 @@ Vue.use(PasswordInput).use(NumberKeyboard);
export default { export default {
data() { data() {
return { return {
value: '', value: '123',
showKeyboard: true showKeyboard: true
}; };
}, },

View File

@ -24,7 +24,7 @@ Vue.use(Step).use(Steps);
export default { export default {
data() { data() {
return { return {
active: 0 active: 1
}; };
} }
} }

View File

@ -33,7 +33,7 @@ Vue.use(PasswordInput).use(NumberKeyboard);
export default { export default {
data() { data() {
return { return {
value: '', value: '123',
showKeyboard: true showKeyboard: true
}; };
}, },

View File

@ -24,7 +24,7 @@ Vue.use(Step).use(Steps);
export default { export default {
data() { data() {
return { return {
active: 0 active: 1
}; };
} }
} }

View File

@ -26,10 +26,9 @@
"deploy:docs": "rimraf docs/dist && cross-env NODE_ENV=production webpack --progress --hide-modules --config build/webpack.doc.js", "deploy:docs": "rimraf docs/dist && cross-env NODE_ENV=production webpack --progress --hide-modules --config build/webpack.doc.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/karma.conf.js --single-run", "test": "jest",
"test:coverage": "open test/coverage/lcov-report/index.html", "test:watch": "jest --watch",
"test:watch": "karma start test/karma.conf.js", "test:coverage": "open test/coverage/index.html",
"test:single": "node ./test/selector.js",
"release": "sh build/release.sh", "release": "sh build/release.sh",
"precommit": "lint-staged" "precommit": "lint-staged"
}, },
@ -58,17 +57,18 @@
"vue": ">= 2.5.0" "vue": ">= 2.5.0"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^8.4.1", "@vue/server-test-utils": "^1.0.0-beta.15",
"avoriaz": "2.0.0", "@vue/test-utils": "^1.0.0-beta.15",
"autoprefixer": "^8.3.0",
"babel-cli": "^6.26.0", "babel-cli": "^6.26.0",
"babel-core": "^6.26.3", "babel-core": "^6.26.3",
"babel-jest": "^22.4.3",
"babel-loader": "^7.1.4", "babel-loader": "^7.1.4",
"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-preset-env": "^1.6.1", "babel-preset-env": "^1.6.1",
"chai": "^4.1.2", "codecov": "^3.0.0",
"codecov": "^3.0.1", "cross-env": "^5.1.5",
"cross-env": "^5.1.4",
"css-loader": "^0.28.11", "css-loader": "^0.28.11",
"dependency-tree": "^6.1.0", "dependency-tree": "^6.1.0",
"eslint": "^4.19.1", "eslint": "^4.19.1",
@ -77,16 +77,10 @@
"gh-pages": "^1.0.0", "gh-pages": "^1.0.0",
"html-webpack-plugin": "3.2.0", "html-webpack-plugin": "3.2.0",
"husky": "^0.14.3", "husky": "^0.14.3",
"istanbul-instrumenter-loader": "^3.0.1", "jest": "^22.4.3",
"karma": "^2.0.0", "jest-serializer-vue": "^1.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.2",
"karma-mocha": "^1.3.0",
"karma-sinon-chai": "^1.3.4",
"karma-spec-reporter": "^0.0.32", "karma-spec-reporter": "^0.0.32",
"karma-webpack": "3.0.0", "lint-staged": "^7.0.4",
"lint-staged": "^7.1.0",
"mocha": "^5.1.1",
"postcss": "^6.0.22", "postcss": "^6.0.22",
"postcss-calc": "^6.0.0", "postcss-calc": "^6.0.0",
"postcss-easy-import": "^3.0.0", "postcss-easy-import": "^3.0.0",
@ -94,22 +88,53 @@
"precss": "2.0.0", "precss": "2.0.0",
"progress-bar-webpack-plugin": "^1.11.0", "progress-bar-webpack-plugin": "^1.11.0",
"rimraf": "^2.5.4", "rimraf": "^2.5.4",
"shelljs": "^0.8.2", "shelljs": "^0.8.1",
"sinon": "^2.4.1",
"sinon-chai": "^2.12.0",
"style-loader": "^0.21.0", "style-loader": "^0.21.0",
"uppercamelcase": "^3.0.0", "uppercamelcase": "^3.0.0",
"url-loader": "^1.0.1", "url-loader": "^1.0.1",
"vant-doc": "1.0.4", "vant-doc": "1.0.4",
"vue": "2.5.16", "vue": "2.5.16",
"vue-loader": "^15.0.9", "vue-jest": "^2.5.0",
"vue-loader": "^15.0.0",
"vue-router": "^3.0.1", "vue-router": "^3.0.1",
"vue-server-renderer": "^2.5.16",
"vue-sfc-compiler": "^0.0.8", "vue-sfc-compiler": "^0.0.8",
"vue-style-loader": "^4.1.0", "vue-style-loader": "^4.1.0",
"vue-template-compiler": "2.5.16", "vue-template-compiler": "2.5.16",
"vue-template-es2015-compiler": "^1.6.0", "vue-template-es2015-compiler": "^1.6.0",
"webpack": "^4.8.1", "webpack": "^4.6.0",
"webpack-cli": "^2.1.3", "webpack-cli": "^2.0.15",
"webpack-dev-server": "3.1.4" "webpack-dev-server": "3.1.4",
"webpack-merge": "^4.1.2"
},
"jest": {
"moduleFileExtensions": [
"js",
"vue"
],
"transform": {
"^.+\\.js$": "<rootDir>/node_modules/babel-jest",
".*\\.(vue)$": "<rootDir>/node_modules/vue-jest"
},
"moduleNameMapper": {
"^packages/(.*)$": "<rootDir>/packages/$1"
},
"snapshotSerializers": [
"<rootDir>/node_modules/jest-serializer-vue"
],
"collectCoverageFrom": [
"packages/**/*.{js,vue}",
"!**/vant-css/**",
"!**/locale/lang/**",
"!**/waterfall/**",
"!**/lazyload/**"
],
"collectCoverage": true,
"coverageReporters": [
"html",
"lcov",
"text-summary"
],
"coverageDirectory": "./test/coverage"
} }
} }

View File

@ -0,0 +1,67 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`callback events 1`] = `
<div class="van-actionsheet" style="display: none;" name="van-slide-bottom">
<ul class="van-hairline--bottom">
<li class="van-actionsheet__item van-hairline--top"><span class="van-actionsheet__name">Option</span>
<!---->
</li>
<li class="van-actionsheet__item van-hairline--top"><span class="van-actionsheet__name">Option</span>
<!---->
</li>
</ul>
<div class="van-actionsheet__cancel van-hairline--top">Cancel</div>
</div>
`;
exports[`renders actionsheet correctly 1`] = `
<div>
<div>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">弹出 Actionsheet</span></button>
<div class="van-actionsheet" style="display:none;">
<ul class="van-hairline--bottom">
<li class="van-actionsheet__item van-hairline--top"><span class="van-actionsheet__name">选项</span>
<!---->
</li>
<li class="van-actionsheet__item van-hairline--top"><span class="van-actionsheet__name">选项</span> <span class="van-actionsheet__subname">描述信息</span></li>
<li class="van-actionsheet__item van-hairline--top">
<div class="van-loading van-loading--circular van-loading--black van-actionsheet__loading" style="width:20px;height:20px;"><span class="van-loading__spinner van-loading__spinner--circular"> <svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div>
</li>
</ul>
<div class="van-actionsheet__content"></div>
</div>
</div>
<div>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">弹出带取消按钮的 Actionsheet</span></button>
<div class="van-actionsheet" style="display:none;">
<ul class="van-hairline--bottom">
<li class="van-actionsheet__item van-hairline--top"><span class="van-actionsheet__name">选项</span>
<!---->
</li>
<li class="van-actionsheet__item van-hairline--top"><span class="van-actionsheet__name">选项</span> <span class="van-actionsheet__subname">描述信息</span></li>
<li class="van-actionsheet__item van-hairline--top">
<div class="van-loading van-loading--circular van-loading--black van-actionsheet__loading" style="width:20px;height:20px;"><span class="van-loading__spinner van-loading__spinner--circular"> <svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div>
</li>
</ul>
<div class="van-actionsheet__cancel van-hairline--top">取消</div>
</div>
</div>
<div>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">弹出带标题的 Actionsheet</span></button>
<div class="van-actionsheet van-actionsheet--withtitle" style="display:none;">
<div class="van-hairline--top-bottom van-actionsheet__header">
<div>标题</div>
<i class="van-icon van-icon-close" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-actionsheet__content">
<p>内容</p>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,26 @@
import { shallow } from '@vue/test-utils';
import Actionsheet from '../';
import demoTest from '../../../test/demo-test';
demoTest(Actionsheet);
test('callback events', () => {
const callback = jest.fn();
const wrapper = shallow(Actionsheet, {
propsData: {
actions: [
{ name: 'Option', callback },
{ name: 'Option' }
],
cancelText: 'Cancel'
}
});
wrapper.findAll('li').trigger('click');
wrapper.find('.van-actionsheet__cancel').trigger('click');
expect(callback.mock.calls.length).toBe(1);
expect(wrapper.emitted('cancel')).toBeTruthy();
expect(wrapper.emitted('input')[0][0]).toBeFalsy();
expect(wrapper.html()).toMatchSnapshot();
});

View File

@ -0,0 +1,165 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders address-edit correctly 1`] = `
<div>
<div>
<div class="van-address-edit">
<div class="van-cell-group van-hairline--top-bottom">
<div maxlength="15" placeholder="名字" class="van-cell van-hairline van-field">
<!---->
<div class="van-cell__title"><span>收货人</span>
<!---->
</div>
<div class="van-cell__value">
<input type="text" maxlength="15" placeholder="名字" value="" class="van-field__control">
<!---->
<!---->
<!---->
</div>
<!---->
</div>
<div placeholder="手机或固定电话" class="van-cell van-hairline van-field">
<!---->
<div class="van-cell__title"><span>联系电话</span>
<!---->
</div>
<div class="van-cell__value">
<input type="tel" placeholder="手机或固定电话" value="" class="van-field__control">
<!---->
<!---->
<!---->
</div>
<!---->
</div>
<div class="van-cell van-cell--clickable van-hairline van-address-edit__area">
<!---->
<div class="van-cell__title"><span>收件地区</span>
<!---->
</div>
<div class="van-cell__value"><span>选择省份</span> <span>选择城市</span> <span>选择地区</span></div>
<!---->
</div>
<div>
<div placeholder="如街道、楼层、门牌号等" maxlength="200" rows="1" class="van-cell van-hairline van-field van-field--has-icon">
<!---->
<div class="van-cell__title"><span>详细地址</span>
<!---->
</div>
<div class="van-cell__value">
<textarea placeholder="如街道、楼层、门牌号等" maxlength="200" rows="1" class="van-field__control"></textarea>
<!---->
<div class="van-field__icon">
<div>
<!---->
</div>
</div>
<!---->
</div>
<!---->
</div>
<!---->
</div>
<div placeholder="邮政编码(选填)" maxlength="6" class="van-hairline--top van-cell van-hairline van-field">
<!---->
<div class="van-cell__title"><span>邮政编码</span>
<!---->
</div>
<div class="van-cell__value">
<input type="tel" placeholder="邮政编码(选填)" maxlength="6" value="" class="van-field__control">
<!---->
<!---->
<!---->
</div>
<!---->
</div>
<div class="van-cell van-cell--center van-switch-cell">
<!---->
<div class="van-cell__title"><span>设为默认收货地址</span>
<!---->
</div>
<div class="van-cell__value">
<div title="设为默认收货地址" class="van-switch" style="font-size:30px;">
<div class="van-switch__node">
<!---->
</div>
</div>
</div>
<!---->
</div>
</div>
<div class="van-address-edit__buttons">
<button class="van-button van-button--primary van-button--normal van-button--block">
<!----><span class="van-button__text">
保存
</span></button>
<button class="van-button van-button--default van-button--normal van-button--block">
<!----><span class="van-button__text">
删除收货地址
</span></button>
</div>
<div class="van-popup van-popup--bottom" style="display:none;">
<div class="van-picker van-area">
<div class="van-hairline--top-bottom van-picker__toolbar">
<div class="van-picker__cancel">取消</div>
<!---->
<div class="van-picker__confirm">确认</div>
</div>
<!---->
<div class="van-picker__columns" style="height:220px;">
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">选择省份</li>
<li class="van-ellipsis van-picker-column__item">北京市</li>
<li class="van-ellipsis van-picker-column__item">天津市</li>
<li class="van-ellipsis van-picker-column__item">河北省</li>
<li class="van-ellipsis van-picker-column__item">山西省</li>
<li class="van-ellipsis van-picker-column__item">内蒙古自治区</li>
<li class="van-ellipsis van-picker-column__item">辽宁省</li>
<li class="van-ellipsis van-picker-column__item">吉林省</li>
<li class="van-ellipsis van-picker-column__item">黑龙江省</li>
<li class="van-ellipsis van-picker-column__item">上海市</li>
<li class="van-ellipsis van-picker-column__item">江苏省</li>
<li class="van-ellipsis van-picker-column__item">浙江省</li>
<li class="van-ellipsis van-picker-column__item">安徽省</li>
<li class="van-ellipsis van-picker-column__item">福建省</li>
<li class="van-ellipsis van-picker-column__item">江西省</li>
<li class="van-ellipsis van-picker-column__item">山东省</li>
<li class="van-ellipsis van-picker-column__item">河南省</li>
<li class="van-ellipsis van-picker-column__item">湖北省</li>
<li class="van-ellipsis van-picker-column__item">湖南省</li>
<li class="van-ellipsis van-picker-column__item">广东省</li>
<li class="van-ellipsis van-picker-column__item">广西壮族自治区</li>
<li class="van-ellipsis van-picker-column__item">海南省</li>
<li class="van-ellipsis van-picker-column__item">重庆市</li>
<li class="van-ellipsis van-picker-column__item">四川省</li>
<li class="van-ellipsis van-picker-column__item">贵州省</li>
<li class="van-ellipsis van-picker-column__item">云南省</li>
<li class="van-ellipsis van-picker-column__item">西藏自治区</li>
<li class="van-ellipsis van-picker-column__item">陕西省</li>
<li class="van-ellipsis van-picker-column__item">甘肃省</li>
<li class="van-ellipsis van-picker-column__item">青海省</li>
<li class="van-ellipsis van-picker-column__item">宁夏回族自治区</li>
<li class="van-ellipsis van-picker-column__item">新疆维吾尔自治区</li>
<li class="van-ellipsis van-picker-column__item">台湾省</li>
<li class="van-ellipsis van-picker-column__item">香港特别行政区</li>
<li class="van-ellipsis van-picker-column__item">澳门特别行政区</li>
</ul>
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">选择城市</li>
</ul>
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">选择地区</li>
</ul>
</div>
<div class="van-hairline--top-bottom van-picker__frame" style="height:44px;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import AddressEdit from '../';
import demoTest from '../../../test/demo-test';
demoTest(AddressEdit);

View File

@ -0,0 +1,56 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders address-list correctly 1`] = `
<div>
<div>
<div class="van-address-list">
<div class="van-radio-group van-address-list__group">
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-cell--clickable van-hairline">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">
<div class="van-radio"><span class="van-radio__input"><input type="radio" value="1" checked="checked" class="van-radio__control"> <i class="van-icon van-icon-checked" style="color:undefined;"> <!----></i></span> <span class="van-radio__label"><div class="van-address-list__name">张三13000000000</div> <div class="van-address-list__address">收货地址:浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室</div></span></div>
</div>
<i class="van-icon van-icon-edit van-address-list__edit" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-cell van-cell--clickable van-hairline">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">
<div class="van-radio"><span class="van-radio__input"><input type="radio" value="2" class="van-radio__control"> <i class="van-icon van-icon-check" style="color:undefined;"> <!----></i></span> <span class="van-radio__label"><div class="van-address-list__name">李四1310000000</div> <div class="van-address-list__address">收货地址:浙江省杭州市拱墅区莫干山路 50 号</div></span></div>
</div>
<i class="van-icon van-icon-edit van-address-list__edit" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-cell van-cell--clickable van-hairline">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">
<div class="van-radio"><span class="van-radio__input"><input type="radio" value="3" class="van-radio__control"> <i class="van-icon van-icon-check" style="color:undefined;"> <!----></i></span> <span class="van-radio__label"><div class="van-address-list__name">王五1320000000</div> <div class="van-address-list__address">收货地址:浙江省杭州市滨江区江南大道 15 号</div></span></div>
</div>
<i class="van-icon van-icon-edit van-address-list__edit" style="color:undefined;">
<!---->
</i>
</div>
</div>
</div>
<div class="van-hairline--top van-cell van-cell--clickable van-hairline van-address-list__add">
<i class="van-icon van-icon-add van-cell__left-icon" style="color:undefined;">
<!---->
</i>
<div class="van-cell__title"><span>新增收货地址</span>
<!---->
</div>
<!---->
<i class="van-icon van-icon-arrow van-cell__right-icon" style="color:undefined;">
<!---->
</i>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import AddressList from '../';
import demoTest from '../../../test/demo-test';
demoTest(AddressList);

View File

@ -0,0 +1,209 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders area correctly 1`] = `
<div>
<div>
<div class="van-picker van-area">
<div class="van-hairline--top-bottom van-picker__toolbar">
<div class="van-picker__cancel">取消</div>
<!---->
<div class="van-picker__confirm">确认</div>
</div>
<!---->
<div class="van-picker__columns" style="height:220px;">
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">选择省份</li>
<li class="van-ellipsis van-picker-column__item">北京市</li>
<li class="van-ellipsis van-picker-column__item">天津市</li>
<li class="van-ellipsis van-picker-column__item">河北省</li>
<li class="van-ellipsis van-picker-column__item">山西省</li>
<li class="van-ellipsis van-picker-column__item">内蒙古自治区</li>
<li class="van-ellipsis van-picker-column__item">辽宁省</li>
<li class="van-ellipsis van-picker-column__item">吉林省</li>
<li class="van-ellipsis van-picker-column__item">黑龙江省</li>
<li class="van-ellipsis van-picker-column__item">上海市</li>
<li class="van-ellipsis van-picker-column__item">江苏省</li>
<li class="van-ellipsis van-picker-column__item">浙江省</li>
<li class="van-ellipsis van-picker-column__item">安徽省</li>
<li class="van-ellipsis van-picker-column__item">福建省</li>
<li class="van-ellipsis van-picker-column__item">江西省</li>
<li class="van-ellipsis van-picker-column__item">山东省</li>
<li class="van-ellipsis van-picker-column__item">河南省</li>
<li class="van-ellipsis van-picker-column__item">湖北省</li>
<li class="van-ellipsis van-picker-column__item">湖南省</li>
<li class="van-ellipsis van-picker-column__item">广东省</li>
<li class="van-ellipsis van-picker-column__item">广西壮族自治区</li>
<li class="van-ellipsis van-picker-column__item">海南省</li>
<li class="van-ellipsis van-picker-column__item">重庆市</li>
<li class="van-ellipsis van-picker-column__item">四川省</li>
<li class="van-ellipsis van-picker-column__item">贵州省</li>
<li class="van-ellipsis van-picker-column__item">云南省</li>
<li class="van-ellipsis van-picker-column__item">西藏自治区</li>
<li class="van-ellipsis van-picker-column__item">陕西省</li>
<li class="van-ellipsis van-picker-column__item">甘肃省</li>
<li class="van-ellipsis van-picker-column__item">青海省</li>
<li class="van-ellipsis van-picker-column__item">宁夏回族自治区</li>
<li class="van-ellipsis van-picker-column__item">新疆维吾尔自治区</li>
<li class="van-ellipsis van-picker-column__item">台湾省</li>
<li class="van-ellipsis van-picker-column__item">香港特别行政区</li>
<li class="van-ellipsis van-picker-column__item">澳门特别行政区</li>
</ul>
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">选择城市</li>
</ul>
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">选择地区</li>
</ul>
</div>
<div class="van-hairline--top-bottom van-picker__frame" style="height:44px;"></div>
</div>
</div>
</div>
<div>
<div class="van-picker van-area">
<div class="van-hairline--top-bottom van-picker__toolbar">
<div class="van-picker__cancel">取消</div>
<!---->
<div class="van-picker__confirm">确认</div>
</div>
<!---->
<div class="van-picker__columns" style="height:220px;">
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">选择省份</li>
<li class="van-ellipsis van-picker-column__item">北京市</li>
<li class="van-ellipsis van-picker-column__item">天津市</li>
<li class="van-ellipsis van-picker-column__item">河北省</li>
<li class="van-ellipsis van-picker-column__item">山西省</li>
<li class="van-ellipsis van-picker-column__item">内蒙古自治区</li>
<li class="van-ellipsis van-picker-column__item">辽宁省</li>
<li class="van-ellipsis van-picker-column__item">吉林省</li>
<li class="van-ellipsis van-picker-column__item">黑龙江省</li>
<li class="van-ellipsis van-picker-column__item">上海市</li>
<li class="van-ellipsis van-picker-column__item">江苏省</li>
<li class="van-ellipsis van-picker-column__item">浙江省</li>
<li class="van-ellipsis van-picker-column__item">安徽省</li>
<li class="van-ellipsis van-picker-column__item">福建省</li>
<li class="van-ellipsis van-picker-column__item">江西省</li>
<li class="van-ellipsis van-picker-column__item">山东省</li>
<li class="van-ellipsis van-picker-column__item">河南省</li>
<li class="van-ellipsis van-picker-column__item">湖北省</li>
<li class="van-ellipsis van-picker-column__item">湖南省</li>
<li class="van-ellipsis van-picker-column__item">广东省</li>
<li class="van-ellipsis van-picker-column__item">广西壮族自治区</li>
<li class="van-ellipsis van-picker-column__item">海南省</li>
<li class="van-ellipsis van-picker-column__item">重庆市</li>
<li class="van-ellipsis van-picker-column__item">四川省</li>
<li class="van-ellipsis van-picker-column__item">贵州省</li>
<li class="van-ellipsis van-picker-column__item">云南省</li>
<li class="van-ellipsis van-picker-column__item">西藏自治区</li>
<li class="van-ellipsis van-picker-column__item">陕西省</li>
<li class="van-ellipsis van-picker-column__item">甘肃省</li>
<li class="van-ellipsis van-picker-column__item">青海省</li>
<li class="van-ellipsis van-picker-column__item">宁夏回族自治区</li>
<li class="van-ellipsis van-picker-column__item">新疆维吾尔自治区</li>
<li class="van-ellipsis van-picker-column__item">台湾省</li>
<li class="van-ellipsis van-picker-column__item">香港特别行政区</li>
<li class="van-ellipsis van-picker-column__item">澳门特别行政区</li>
</ul>
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">选择城市</li>
<li class="van-ellipsis van-picker-column__item">杭州市</li>
<li class="van-ellipsis van-picker-column__item">宁波市</li>
<li class="van-ellipsis van-picker-column__item">温州市</li>
<li class="van-ellipsis van-picker-column__item">嘉兴市</li>
<li class="van-ellipsis van-picker-column__item">湖州市</li>
<li class="van-ellipsis van-picker-column__item">绍兴市</li>
<li class="van-ellipsis van-picker-column__item">金华市</li>
<li class="van-ellipsis van-picker-column__item">衢州市</li>
<li class="van-ellipsis van-picker-column__item">舟山市</li>
<li class="van-ellipsis van-picker-column__item">台州市</li>
<li class="van-ellipsis van-picker-column__item">丽水市</li>
</ul>
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">选择地区</li>
<li class="van-ellipsis van-picker-column__item">鹿城区</li>
<li class="van-ellipsis van-picker-column__item">龙湾区</li>
<li class="van-ellipsis van-picker-column__item">瓯海区</li>
<li class="van-ellipsis van-picker-column__item">洞头区</li>
<li class="van-ellipsis van-picker-column__item">永嘉县</li>
<li class="van-ellipsis van-picker-column__item">平阳县</li>
<li class="van-ellipsis van-picker-column__item">苍南县</li>
<li class="van-ellipsis van-picker-column__item">文成县</li>
<li class="van-ellipsis van-picker-column__item">泰顺县</li>
<li class="van-ellipsis van-picker-column__item">瑞安市</li>
<li class="van-ellipsis van-picker-column__item">乐清市</li>
</ul>
</div>
<div class="van-hairline--top-bottom van-picker__frame" style="height:44px;"></div>
</div>
</div>
</div>
<div>
<div class="van-picker van-area">
<div class="van-hairline--top-bottom van-picker__toolbar">
<div class="van-picker__cancel">取消</div>
<div class="van-ellipsis van-picker__title">标题</div>
<div class="van-picker__confirm">确认</div>
</div>
<!---->
<div class="van-picker__columns" style="height:220px;">
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">选择省份</li>
<li class="van-ellipsis van-picker-column__item">北京市</li>
<li class="van-ellipsis van-picker-column__item">天津市</li>
<li class="van-ellipsis van-picker-column__item">河北省</li>
<li class="van-ellipsis van-picker-column__item">山西省</li>
<li class="van-ellipsis van-picker-column__item">内蒙古自治区</li>
<li class="van-ellipsis van-picker-column__item">辽宁省</li>
<li class="van-ellipsis van-picker-column__item">吉林省</li>
<li class="van-ellipsis van-picker-column__item">黑龙江省</li>
<li class="van-ellipsis van-picker-column__item">上海市</li>
<li class="van-ellipsis van-picker-column__item">江苏省</li>
<li class="van-ellipsis van-picker-column__item">浙江省</li>
<li class="van-ellipsis van-picker-column__item">安徽省</li>
<li class="van-ellipsis van-picker-column__item">福建省</li>
<li class="van-ellipsis van-picker-column__item">江西省</li>
<li class="van-ellipsis van-picker-column__item">山东省</li>
<li class="van-ellipsis van-picker-column__item">河南省</li>
<li class="van-ellipsis van-picker-column__item">湖北省</li>
<li class="van-ellipsis van-picker-column__item">湖南省</li>
<li class="van-ellipsis van-picker-column__item">广东省</li>
<li class="van-ellipsis van-picker-column__item">广西壮族自治区</li>
<li class="van-ellipsis van-picker-column__item">海南省</li>
<li class="van-ellipsis van-picker-column__item">重庆市</li>
<li class="van-ellipsis van-picker-column__item">四川省</li>
<li class="van-ellipsis van-picker-column__item">贵州省</li>
<li class="van-ellipsis van-picker-column__item">云南省</li>
<li class="van-ellipsis van-picker-column__item">西藏自治区</li>
<li class="van-ellipsis van-picker-column__item">陕西省</li>
<li class="van-ellipsis van-picker-column__item">甘肃省</li>
<li class="van-ellipsis van-picker-column__item">青海省</li>
<li class="van-ellipsis van-picker-column__item">宁夏回族自治区</li>
<li class="van-ellipsis van-picker-column__item">新疆维吾尔自治区</li>
<li class="van-ellipsis van-picker-column__item">台湾省</li>
<li class="van-ellipsis van-picker-column__item">香港特别行政区</li>
<li class="van-ellipsis van-picker-column__item">澳门特别行政区</li>
</ul>
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">选择城市</li>
</ul>
</div>
<div class="van-hairline--top-bottom van-picker__frame" style="height:44px;"></div>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Area from '../';
import demoTest from '../../../test/demo-test';
demoTest(Area);

View File

@ -0,0 +1,26 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders badge correctly 1`] = `
<div>
<div>
<div class="van-hairline--top-bottom van-badge-group">
<a class="van-badge van-badge--select van-hairline">
<!---->
标签名称
</a>
<a class="van-badge van-hairline">
<div class="van-badge__info">8</div>
标签名称
</a>
<a class="van-badge van-hairline">
<div class="van-badge__info">99</div>
标签名称
</a>
<a class="van-badge van-hairline">
<div class="van-badge__info">199</div>
标签名称
</a>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,27 @@
import { mount } from '@vue/test-utils';
import Badge from '../';
import BadgeGroup from '../../badge-group';
import demoTest from '../../../test/demo-test';
demoTest(Badge);
test('click', () => {
const onClick = jest.fn();
const wrapper = mount({
template: `
<badge-group>
<badge @click="onClick">Text</badge>
</badge-group>
`,
components: {
Badge,
BadgeGroup
},
methods: {
onClick
}
});
wrapper.find('.van-badge').trigger('click');
expect(onClick.mock.calls[0][0]).toBe(0);
});

View File

@ -0,0 +1,55 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders button correctly 1`] = `
<div>
<div>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">默认按钮</span></button>
<button class="van-button van-button--primary van-button--normal">
<!----><span class="van-button__text">主要按钮</span></button>
<button class="van-button van-button--danger van-button--normal">
<!----><span class="van-button__text">危险按钮</span></button>
</div>
<div>
<button class="van-button van-button--default van-button--large">
<!----><span class="van-button__text">大号按钮</span></button>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">普通按钮</span></button>
<button class="van-button van-button--default van-button--small">
<!----><span class="van-button__text">小型按钮</span></button>
<button class="van-button van-button--default van-button--mini">
<!----><span class="van-button__text">迷你按钮</span></button>
</div>
<div>
<button disabled="disabled" class="van-button van-button--default van-button--normal van-button--disabled van-button--unclickable">
<!----><span class="van-button__text">禁用状态</span></button>
</div>
<div>
<button class="van-button van-button--default van-button--normal van-button--loading van-button--unclickable">
<div class="van-loading van-loading--circular van-loading--black" style="width:20px;height:20px;"><span class="van-loading__spinner van-loading__spinner--circular"> <svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div> <span class="van-button__text"></span></button>
<button
class="van-button van-button--primary van-button--normal van-button--loading van-button--unclickable">
<div class="van-loading van-loading--circular van-loading--white" style="width:20px;height:20px;"><span class="van-loading__spinner van-loading__spinner--circular"> <svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div> <span class="van-button__text"></span></button>
</div>
<div>
<a href="https://www.youzan.com" target="_blank" class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">
按钮
</span></a>
</div>
<div>
<button class="van-button van-button--primary van-button--normal van-button--bottom-action">
<!----><span class="van-button__text">按钮</span></button>
<div class="van-row">
<div class="van-col van-col-12">
<button class="van-button van-button--default van-button--normal van-button--bottom-action">
<!----><span class="van-button__text">按钮</span></button>
</div>
<div class="van-col van-col-12">
<button class="van-button van-button--primary van-button--normal van-button--bottom-action">
<!----><span class="van-button__text">按钮</span></button>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Button from '../';
import demoTest from '../../../test/demo-test';
demoTest(Button);

View File

@ -0,0 +1,49 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders card correctly 1`] = `
<div>
<div>
<div class="van-card">
<div class="van-card__thumb">
<img src="//img.yzcdn.cn/upload_files/2017/07/02/af5b9f44deaeb68000d7e4a711160c53.jpg" class="van-card__img">
</div>
<div class="van-card__content">
<div class="van-card__row">
<div class="van-card__title">标题</div>
<div class="van-card__price">¥ 2.00</div>
</div>
<div class="van-card__row">
<div class="van-card__desc">描述信息</div>
<div class="van-card__num">x 2</div>
</div>
</div>
<!---->
</div>
</div>
<div>
<div class="van-card">
<div class="van-card__thumb">
<img src="//img.yzcdn.cn/upload_files/2017/07/02/af5b9f44deaeb68000d7e4a711160c53.jpg" class="van-card__img">
</div>
<div class="van-card__content">
<div class="van-card__row">
<div class="van-card__title">标题</div>
<div class="van-card__price">¥ 2.00</div>
</div>
<div class="van-card__row">
<div class="van-card__desc">描述信息</div>
<div class="van-card__num">x 2</div>
</div>
</div>
<div class="van-card__footer">
<div>
<button class="van-button van-button--default van-button--mini">
<!----><span class="van-button__text">按钮</span></button>
<button class="van-button van-button--default van-button--mini">
<!----><span class="van-button__text">按钮</span></button>
</div>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Card from '../';
import demoTest from '../../../test/demo-test';
demoTest(Card);

View File

@ -0,0 +1,51 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders cell-swipe correctly 1`] = `
<div>
<div>
<div class="van-notice-bar" style="color:undefined;background:undefined;">
<!---->
<div class="van-notice-bar__wrap">
<div class="van-notice-bar__content" style="padding-left:0;animation-delay:1s;animation-duration:0s;">建议在手机模式下浏览本示例</div>
</div>
<!---->
</div>
<div>
<div class="van-cell-swipe">
<div class="van-cell-swipe__wrapper" style="transform:translate3d(0px, 0, 0);transition:.6s cubic-bezier(0.18, 0.89, 0.32, 1);">
<div class="van-cell-swipe__left"><span>选择</span></div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-hairline">
<!---->
<div class="van-cell__title"><span>单元格</span>
<!---->
</div>
<div class="van-cell__value"><span>内容</span></div>
<!---->
</div>
</div>
<div class="van-cell-swipe__right"><span>删除</span></div>
</div>
</div>
</div>
<div>
<div class="van-cell-swipe">
<div class="van-cell-swipe__wrapper" style="transform:translate3d(0px, 0, 0);transition:.6s cubic-bezier(0.18, 0.89, 0.32, 1);">
<div class="van-cell-swipe__left"><span>选择</span></div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-hairline">
<!---->
<div class="van-cell__title"><span>单元格</span>
<!---->
</div>
<div class="van-cell__value"><span>内容</span></div>
<!---->
</div>
</div>
<div class="van-cell-swipe__right"><span>删除</span></div>
</div>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import CellSwipe from '../';
import demoTest from '../../../test/demo-test';
demoTest(CellSwipe);

View File

@ -0,0 +1,110 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders cell correctly 1`] = `
<div>
<div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-hairline">
<!---->
<div class="van-cell__title"><span>单元格</span>
<!---->
</div>
<div class="van-cell__value"><span>内容</span></div>
<!---->
</div>
<div class="van-cell van-hairline">
<!---->
<div class="van-cell__title"><span>单元格</span>
<div class="van-cell__label">描述信息</div>
</div>
<div class="van-cell__value"><span>内容</span></div>
<!---->
</div>
</div>
</div>
<div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-hairline">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone"><span>内容</span></div>
<!---->
</div>
</div>
</div>
<div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-hairline">
<i class="van-icon van-icon-location van-cell__left-icon" style="color:undefined;">
<!---->
</i>
<div class="van-cell__title"><span>单元格</span>
<!---->
</div>
<!---->
<!---->
</div>
</div>
</div>
<div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-cell--clickable van-hairline">
<!---->
<div class="van-cell__title"><span>单元格</span>
<!---->
</div>
<!---->
<i class="van-icon van-icon-arrow van-cell__right-icon" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-cell van-cell--clickable van-hairline">
<!---->
<div class="van-cell__title"><span>单元格</span>
<!---->
</div>
<div class="van-cell__value"><span>内容</span></div>
<i class="van-icon van-icon-arrow van-cell__right-icon" style="color:undefined;">
<!---->
</i>
</div>
</div>
</div>
<div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-cell--clickable van-hairline">
<i class="van-icon van-icon-shop van-cell__left-icon" style="color:undefined;">
<!---->
</i>
<div class="van-cell__title"><span class="van-cell-text">单元格</span> <span class="van-hairline--surround van-tag van-tag--danger">标签</span></div>
<div class="van-cell__value"><span>内容</span></div>
<i class="van-icon van-icon-arrow van-cell__right-icon" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-cell van-cell--clickable van-hairline">
<i class="van-icon van-icon-location van-cell__left-icon" style="color:undefined;">
<!---->
</i>
<div class="van-cell__title"><span>单元格</span>
<!---->
</div>
<!---->
<i class="van-icon van-icon-arrow van-cell__right-icon" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-cell van-hairline">
<!---->
<div class="van-cell__title"><span>单元格</span>
<!---->
</div>
<!---->
<i class="van-cell__right-icon van-icon van-icon-search" style="color:undefined;">
<!---->
</i>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Cell from '../';
import demoTest from '../../../test/demo-test';
demoTest(Cell);

View File

@ -0,0 +1,123 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders checkbox correctly 1`] = `
<div>
<div>
<div class="van-checkbox">
<i class="van-icon van-icon-success van-checkbox__icon van-checkbox--round van-checkbox--checked" style="color:undefined;">
<!---->
</i> <span class="van-checkbox__label">复选框</span></div>
</div>
<div>
<div class="van-checkbox">
<i class="van-icon van-icon-success van-checkbox__icon van-checkbox--round van-checkbox--disabled" style="color:undefined;">
<!---->
</i> <span class="van-checkbox__label">复选框</span></div>
<div class="van-checkbox">
<i class="van-icon van-icon-success van-checkbox__icon van-checkbox--round van-checkbox--disabled van-checkbox--checked" style="color:undefined;">
<!---->
</i> <span class="van-checkbox__label">复选框</span></div>
</div>
<div>
<div class="van-checkbox">
<i class="van-icon van-icon-success van-checkbox__icon van-checkbox--round van-checkbox--checked" style="color:undefined;">
<!---->
</i> <span class="van-checkbox__label">复选框</span></div>
</div>
<div>
<div class="van-checkbox-group">
<div class="van-checkbox">
<i class="van-icon van-icon-success van-checkbox__icon van-checkbox--round van-checkbox--checked" style="color:undefined;">
<!---->
</i> <span class="van-checkbox__label">
复选框 a
</span></div>
<div class="van-checkbox">
<i class="van-icon van-icon-success van-checkbox__icon van-checkbox--round van-checkbox--checked" style="color:undefined;">
<!---->
</i> <span class="van-checkbox__label">
复选框 b
</span></div>
<div class="van-checkbox">
<i class="van-icon van-icon-success van-checkbox__icon van-checkbox--round" style="color:undefined;">
<!---->
</i> <span class="van-checkbox__label">
复选框 c
</span></div>
</div>
</div>
<div>
<div class="van-checkbox-group">
<div class="van-checkbox">
<i class="van-icon van-icon-success van-checkbox__icon van-checkbox--round" style="color:undefined;">
<!---->
</i> <span class="van-checkbox__label">
复选框 a
</span></div>
<div class="van-checkbox">
<i class="van-icon van-icon-success van-checkbox__icon van-checkbox--round" style="color:undefined;">
<!---->
</i> <span class="van-checkbox__label">
复选框 b
</span></div>
<div class="van-checkbox">
<i class="van-icon van-icon-success van-checkbox__icon van-checkbox--round" style="color:undefined;">
<!---->
</i> <span class="van-checkbox__label">
复选框 c
</span></div>
</div>
</div>
<div>
<div class="van-checkbox-group">
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-hairline">
<!---->
<div class="van-cell__title"><span>复选框a</span>
<!---->
</div>
<div class="van-cell__value">
<div class="van-checkbox">
<i class="van-icon van-icon-success van-checkbox__icon van-checkbox--round" style="color:undefined;">
<!---->
</i>
<!---->
</div>
</div>
<!---->
</div>
<div class="van-cell van-hairline">
<!---->
<div class="van-cell__title"><span>复选框b</span>
<!---->
</div>
<div class="van-cell__value">
<div class="van-checkbox">
<i class="van-icon van-icon-success van-checkbox__icon van-checkbox--round" style="color:undefined;">
<!---->
</i>
<!---->
</div>
</div>
<!---->
</div>
<div class="van-cell van-hairline">
<!---->
<div class="van-cell__title"><span>复选框c</span>
<!---->
</div>
<div class="van-cell__value">
<div class="van-checkbox">
<i class="van-icon van-icon-success van-checkbox__icon van-checkbox--round" style="color:undefined;">
<!---->
</i>
<!---->
</div>
</div>
<!---->
</div>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Checkbox from '../';
import demoTest from '../../../test/demo-test';
demoTest(Checkbox);

View File

@ -0,0 +1,28 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders circle correctly 1`] = `
<div>
<div>
<div class="van-circle" style="width:120px;height:120px;">
<svg viewBox="0 0 1060 1060">
<path d="M 530 530 m -500, 0 a 500, 500 0 1, 1 1000, 0 a 500, 500 0 1, 1 -1000, 0" class="van-circle__hover" style="fill:none;stroke:#fff;stroke-width:40px;"></path>
<path d="M 530 530 m -500, 0 a 500, 500 0 1, 1 1000, 0 a 500, 500 0 1, 1 -1000, 0" class="van-circle__layer" style="stroke:#38f;stroke-dashoffset:3140px;stroke-width:41px;"></path>
</svg>
<div class="van-circle__text">0%</div>
</div>
<div class="van-circle" style="width:120px;height:120px;">
<svg viewBox="0 0 1060 1060">
<path d="M 530 530 m -500, 0 a 500, 500 0 1, 1 1000, 0 a 500, 500 0 1, 1 -1000, 0" class="van-circle__hover" style="fill:#fff;stroke:#eee;stroke-width:60px;"></path>
<path d="M 530 530 m -500, 0 a 500, 500 0 1, 1 1000, 0 a 500, 500 0 1, 1 -1000, 0" class="van-circle__layer" style="stroke:#13ce66;stroke-dashoffset:3140px;stroke-width:61px;"></path>
</svg>
<div class="van-circle__text">0%</div>
</div>
<div>
<button class="van-button van-button--primary van-button--small">
<!----><span class="van-button__text">增加</span></button>
<button class="van-button van-button--danger van-button--small">
<!----><span class="van-button__text">减少</span></button>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Circle from '../';
import demoTest from '../../../test/demo-test';
demoTest(Circle);

View File

@ -0,0 +1,27 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders layout correctly 1`] = `
<div>
<div>
<div class="van-row">
<div class="van-col van-col-8">span: 8</div>
<div class="van-col van-col-8">span: 8</div>
<div class="van-col van-col-8">span: 8</div>
</div>
<div class="van-row">
<div class="van-col van-col-4">span: 4</div>
<div class="van-col van-col-10 van-col-offset-4">offset: 4, span: 10</div>
</div>
<div class="van-row">
<div class="van-col van-col-12 van-col-offset-12">offset: 12, span: 12</div>
</div>
</div>
<div>
<div class="van-row" style="margin-left:-10px;margin-right:-10px;">
<div class="van-col van-col-8" style="padding-left:10px;padding-right:10px;">span: 8</div>
<div class="van-col van-col-8" style="padding-left:10px;padding-right:10px;">span: 8</div>
<div class="van-col van-col-8" style="padding-left:10px;padding-right:10px;">span: 8</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,3 @@
import demoTest from '../../../test/demo-test';
demoTest('layout');

View File

@ -0,0 +1,114 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders collapse correctly 1`] = `
<div>
<div>
<div class="van-hairline--top-bottom van-collapse">
<div class="van-collapse-item van-collapse-item--expanded">
<div class="van-cell van-cell--clickable van-hairline van-collapse-item__title">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">有赞微商城</div>
<i class="van-icon van-icon-arrow van-cell__right-icon" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-collapse-item__content">提供多样店铺模板,快速搭建网上商城</div>
</div>
<div class="van-collapse-item van-hairline--top">
<div class="van-cell van-cell--clickable van-hairline van-collapse-item__title">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">有赞零售</div>
<i class="van-icon van-icon-arrow van-cell__right-icon" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-collapse-item__content" style="display:none;">网店吸粉获客、会员分层营销、一机多种收款,告别经营低效和客户流失</div>
</div>
<div class="van-collapse-item van-hairline--top">
<div class="van-cell van-cell--clickable van-hairline van-collapse-item__title">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">有赞美业</div>
<i class="van-icon van-icon-arrow van-cell__right-icon" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-collapse-item__content" style="display:none;">线上拓客,随时预约,贴心顺手的开单收银</div>
</div>
</div>
</div>
<div>
<div class="van-hairline--top-bottom van-collapse">
<div class="van-collapse-item van-collapse-item--expanded">
<div class="van-cell van-cell--clickable van-hairline van-collapse-item__title">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">有赞微商城</div>
<i class="van-icon van-icon-arrow van-cell__right-icon" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-collapse-item__content">提供多样店铺模板,快速搭建网上商城</div>
</div>
<div class="van-collapse-item van-hairline--top">
<div class="van-cell van-cell--clickable van-hairline van-collapse-item__title">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">有赞零售</div>
<i class="van-icon van-icon-arrow van-cell__right-icon" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-collapse-item__content" style="display:none;">网店吸粉获客、会员分层营销、一机多种收款,告别经营低效和客户流失</div>
</div>
<div class="van-collapse-item van-hairline--top">
<div class="van-cell van-cell--clickable van-hairline van-collapse-item__title">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">有赞美业</div>
<i class="van-icon van-icon-arrow van-cell__right-icon" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-collapse-item__content" style="display:none;">线上拓客,随时预约,贴心顺手的开单收银</div>
</div>
</div>
</div>
<div>
<div class="van-hairline--top-bottom van-collapse">
<div class="van-collapse-item">
<div class="van-cell van-cell--clickable van-hairline van-collapse-item__title">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">
<div>有赞微商城
<i class="van-icon van-icon-question" style="color:undefined;">
<!---->
</i>
</div>
</div>
<i class="van-icon van-icon-arrow van-cell__right-icon" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-collapse-item__content" style="display:none;">
提供多样店铺模板,快速搭建网上商城
</div>
</div>
<div class="van-collapse-item van-hairline--top">
<div class="van-cell van-cell--clickable van-hairline van-collapse-item__title">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">有赞零售</div>
<i class="van-icon van-icon-arrow van-cell__right-icon" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-collapse-item__content" style="display:none;">网店吸粉获客、会员分层营销、一机多种收款,告别经营低效和客户流失</div>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Collapse from '../';
import demoTest from '../../../test/demo-test';
demoTest(Collapse);

View File

@ -0,0 +1,100 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders contact correctly 1`] = `
<div>
<div>
<div class="van-contact-card van-contact-card--add">
<div class="van-contact-card__content">
<i class="van-icon van-icon-add2 van-contact-card__icon" style="color:undefined;">
<!---->
</i>
<div class="van-contact-card__text">添加订单联系人信息</div>
</div>
<i class="van-icon van-icon-arrow van-contact-card__arrow" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-popup van-popup--bottom" style="display:none;">
<div class="van-contact-list">
<div class="van-radio-group">
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-cell--clickable van-hairline">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">
<div class="van-radio"><span class="van-radio__input"><input type="radio" value="0" class="van-radio__control"> <i class="van-icon van-icon-check" style="color:undefined;"> <!----></i></span> <span class="van-radio__label"><p class="van-contact-list__text">联系人:张三</p> <p class="van-contact-list__text">联系电话13000000000</p></span></div>
</div>
<i class="van-icon van-icon-edit van-contact-list__edit" style="color:undefined;">
<!---->
</i>
</div>
</div>
</div>
<div class="van-hairline--top van-cell van-cell--clickable van-hairline van-contact-list__add">
<i class="van-icon van-icon-add van-cell__left-icon" style="color:undefined;">
<!---->
</i>
<div class="van-cell__title"><span>新建联系人</span>
<!---->
</div>
<!---->
<i class="van-icon van-icon-arrow van-cell__right-icon" style="color:undefined;">
<!---->
</i>
</div>
</div>
</div>
<div class="van-popup van-popup--bottom" style="display:none;">
<div class="van-contact-edit">
<div class="van-cell-group van-hairline--top-bottom">
<div maxlength="30" placeholder="名字" class="van-cell van-hairline van-field">
<!---->
<div class="van-cell__title"><span>联系人</span>
<!---->
</div>
<div class="van-cell__value">
<input type="text" maxlength="30" placeholder="名字" class="van-field__control">
<!---->
<!---->
<!---->
</div>
<!---->
</div>
<div placeholder="手机或固定电话" class="van-cell van-hairline van-field">
<!---->
<div class="van-cell__title"><span>联系电话</span>
<!---->
</div>
<div class="van-cell__value">
<input type="tel" placeholder="手机或固定电话" class="van-field__control">
<!---->
<!---->
<!---->
</div>
<!---->
</div>
</div>
<div class="van-contact-edit__buttons">
<button class="van-button van-button--primary van-button--normal van-button--block">
<!----><span class="van-button__text">保存</span></button>
<!---->
</div>
</div>
</div>
</div>
<div>
<div class="van-contact-card van-contact-card--edit van-contact-card--uneditable">
<div class="van-contact-card__content">
<i class="van-icon van-icon-contact van-contact-card__icon" style="color:undefined;">
<!---->
</i>
<div class="van-contact-card__text">
<div>联系人:张三</div>
<div>联系电话13000000000</div>
</div>
</div>
<!---->
</div>
</div>
</div>
`;

View File

@ -0,0 +1,3 @@
import demoTest from '../../../test/demo-test';
demoTest('contact');

View File

@ -0,0 +1,130 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`coupon cell 1`] = `
<div class="van-cell-group van-hairline--top-bottom van-coupon-cell">
<div class="van-cell van-cell--clickable van-hairline">
<!---->
<div class="van-cell__title"><span>优惠券码</span>
<!---->
</div>
<div class="van-cell__value"><span>使用优惠</span></div>
<i class="van-icon van-icon-arrow van-cell__right-icon">
<!---->
</i>
</div>
</div>
`;
exports[`coupon cell 2`] = `
<div class="van-cell-group van-hairline--top-bottom van-coupon-cell">
<div class="van-cell van-cell--clickable van-hairline">
<!---->
<div class="van-cell__title"><span>优惠券码</span>
<!---->
</div>
<div class="van-cell__value"><span>省¥1.00</span></div>
<i class="van-icon van-icon-arrow van-cell__right-icon">
<!---->
</i>
</div>
</div>
`;
exports[`renders coupon correctly 1`] = `
<div>
<div>
<div class="van-cell-group van-hairline--top-bottom van-coupon-cell">
<div class="van-cell van-cell--clickable van-hairline">
<!---->
<div class="van-cell__title"><span>优惠券码</span>
<!---->
</div>
<div class="van-cell__value"><span>您有 2 个可用优惠</span></div>
<i class="van-icon van-icon-arrow van-cell__right-icon" style="color:undefined;">
<!---->
</i>
</div>
</div>
<div class="van-popup van-popup--bottom" style="display:none;">
<div class="van-coupon-list">
<div class="van-cell-group van-hairline--top-bottom van-coupon-list__top">
<div placeholder="请输入优惠码" maxlength="20" class="van-hairline--surround van-cell van-hairline van-field van-coupon-list__field">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">
<input type="text" placeholder="请输入优惠码" maxlength="20" value="" class="van-field__control">
<!---->
<!---->
<!---->
</div>
<!---->
</div>
<button disabled="disabled" class="van-button van-button--danger van-button--small van-button--disabled van-button--unclickable van-coupon-list__exchange">
<!----><span class="van-button__text">兑换</span></button>
</div>
<div class="van-coupon-list__list van-coupon-list__list--with-exchange">
<div class="van-coupon-item">
<div class="van-coupon-item__head">
<div class="van-coupon-item__lines"></div>
<div class="van-coupon-item__gradient">
<h2><span>¥</span> 1.5</h2>
<p>无使用门槛</p>
</div>
</div>
<div class="van-coupon-item__body">
<h2>优惠券名称</h2> <span>2017.03.10-2017.12.30</span>
<!---->
<!---->
</div>
</div>
<div class="van-coupon-item">
<div class="van-coupon-item__head">
<div class="van-coupon-item__lines"></div>
<div class="van-coupon-item__gradient">
<h2>8.8折</h2>
<p>满0.50元可用</p>
</div>
</div>
<div class="van-coupon-item__body">
<h2>优惠券名称</h2> <span>2017.03.10-2017.12.30</span>
<!---->
<!---->
</div>
</div>
<h3>不可用优惠</h3>
<div class="van-coupon-item van-coupon-item--disabled">
<div class="van-coupon-item__head">
<div class="van-coupon-item__lines"></div>
<div class="van-coupon-item__gradient">
<h2><span>¥</span> 1.5</h2>
<p>无使用门槛</p>
</div>
</div>
<div class="van-coupon-item__body">
<h2>优惠券名称</h2> <span>2017.03.10-2017.12.30</span>
<p>优惠券不可用原因</p>
<!---->
</div>
</div>
<div class="van-coupon-item van-coupon-item--disabled">
<div class="van-coupon-item__head">
<div class="van-coupon-item__lines"></div>
<div class="van-coupon-item__gradient">
<h2>1折</h2>
<p>满0.50元可用</p>
</div>
</div>
<div class="van-coupon-item__body">
<h2>优惠券名称</h2> <span>2017.03.10-2017.12.30</span>
<p>优惠券不可用原因</p>
<!---->
</div>
</div>
<!---->
</div>
<div class="van-hairline--top van-coupon-list__close">不使用优惠</div>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,34 @@
import demoTest from '../../../test/demo-test';
import CouponList from '../../coupon-list';
import CouponCell from '../../coupon-cell';
import { mount } from '@vue/test-utils';
demoTest('coupon');
test('exchange coupon', () => {
const wrapper = mount(CouponList);
const exchange = wrapper.find('.van-coupon-list__exchange');
wrapper.vm.displayedCouponIndex = 1;
wrapper.vm.currentCode = '1';
exchange.trigger('click');
wrapper.vm.code = '2';
exchange.trigger('click');
expect(wrapper.emitted('exchange')[0][0]).toBe('1');
expect(wrapper.emitted('exchange')[1][0]).toBe('2');
expect(wrapper.emitted('input')[0][0]).toBe('1');
expect(wrapper.emitted('input')[1][0]).toBe('');
expect(wrapper.emitted('input')[2][0]).toBe('2');
});
test('coupon cell', () => {
const wrapper = mount(CouponCell);
expect(wrapper.html()).toMatchSnapshot();
wrapper.setProps({
coupons: [{ value: 100 }],
chosenCoupon: 0
});
expect(wrapper.html()).toMatchSnapshot();
});

View File

@ -159,6 +159,7 @@ export default create({
this.$nextTick(() => { this.$nextTick(() => {
const { card, list } = this.$refs; const { card, list } = this.$refs;
/* istanbul ignore next */
if (list && card && card[index]) { if (list && card && card[index]) {
list.scrollTop = card[index].$el.offsetTop - 100; list.scrollTop = card[index].$el.offsetTop - 100;
} }

View File

@ -0,0 +1,349 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders datetime-picker correctly 1`] = `
<div>
<div>
<div class="van-picker">
<div class="van-hairline--top-bottom van-picker__toolbar">
<div class="van-picker__cancel">取消</div>
<!---->
<div class="van-picker__confirm">确认</div>
</div>
<!---->
<div class="van-picker__columns" style="height:220px;">
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">2018</li>
<li class="van-ellipsis van-picker-column__item">2019</li>
</ul>
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">05</li>
<li class="van-ellipsis van-picker-column__item">06</li>
<li class="van-ellipsis van-picker-column__item">07</li>
<li class="van-ellipsis van-picker-column__item">08</li>
<li class="van-ellipsis van-picker-column__item">09</li>
<li class="van-ellipsis van-picker-column__item">10</li>
<li class="van-ellipsis van-picker-column__item">11</li>
<li class="van-ellipsis van-picker-column__item">12</li>
</ul>
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">12</li>
<li class="van-ellipsis van-picker-column__item">13</li>
<li class="van-ellipsis van-picker-column__item">14</li>
<li class="van-ellipsis van-picker-column__item">15</li>
<li class="van-ellipsis van-picker-column__item">16</li>
<li class="van-ellipsis van-picker-column__item">17</li>
<li class="van-ellipsis van-picker-column__item">18</li>
<li class="van-ellipsis van-picker-column__item">19</li>
<li class="van-ellipsis van-picker-column__item">20</li>
<li class="van-ellipsis van-picker-column__item">21</li>
<li class="van-ellipsis van-picker-column__item">22</li>
<li class="van-ellipsis van-picker-column__item">23</li>
<li class="van-ellipsis van-picker-column__item">24</li>
<li class="van-ellipsis van-picker-column__item">25</li>
<li class="van-ellipsis van-picker-column__item">26</li>
<li class="van-ellipsis van-picker-column__item">27</li>
<li class="van-ellipsis van-picker-column__item">28</li>
<li class="van-ellipsis van-picker-column__item">29</li>
<li class="van-ellipsis van-picker-column__item">30</li>
<li class="van-ellipsis van-picker-column__item">31</li>
</ul>
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">00</li>
<li class="van-ellipsis van-picker-column__item">01</li>
<li class="van-ellipsis van-picker-column__item">02</li>
<li class="van-ellipsis van-picker-column__item">03</li>
<li class="van-ellipsis van-picker-column__item">04</li>
<li class="van-ellipsis van-picker-column__item">05</li>
<li class="van-ellipsis van-picker-column__item">06</li>
<li class="van-ellipsis van-picker-column__item">07</li>
<li class="van-ellipsis van-picker-column__item">08</li>
<li class="van-ellipsis van-picker-column__item">09</li>
<li class="van-ellipsis van-picker-column__item">10</li>
<li class="van-ellipsis van-picker-column__item">11</li>
<li class="van-ellipsis van-picker-column__item">12</li>
<li class="van-ellipsis van-picker-column__item">13</li>
<li class="van-ellipsis van-picker-column__item">14</li>
<li class="van-ellipsis van-picker-column__item">15</li>
<li class="van-ellipsis van-picker-column__item">16</li>
<li class="van-ellipsis van-picker-column__item">17</li>
<li class="van-ellipsis van-picker-column__item">18</li>
<li class="van-ellipsis van-picker-column__item">19</li>
<li class="van-ellipsis van-picker-column__item">20</li>
<li class="van-ellipsis van-picker-column__item">21</li>
<li class="van-ellipsis van-picker-column__item">22</li>
<li class="van-ellipsis van-picker-column__item">23</li>
</ul>
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">00</li>
<li class="van-ellipsis van-picker-column__item">01</li>
<li class="van-ellipsis van-picker-column__item">02</li>
<li class="van-ellipsis van-picker-column__item">03</li>
<li class="van-ellipsis van-picker-column__item">04</li>
<li class="van-ellipsis van-picker-column__item">05</li>
<li class="van-ellipsis van-picker-column__item">06</li>
<li class="van-ellipsis van-picker-column__item">07</li>
<li class="van-ellipsis van-picker-column__item">08</li>
<li class="van-ellipsis van-picker-column__item">09</li>
<li class="van-ellipsis van-picker-column__item">10</li>
<li class="van-ellipsis van-picker-column__item">11</li>
<li class="van-ellipsis van-picker-column__item">12</li>
<li class="van-ellipsis van-picker-column__item">13</li>
<li class="van-ellipsis van-picker-column__item">14</li>
<li class="van-ellipsis van-picker-column__item">15</li>
<li class="van-ellipsis van-picker-column__item">16</li>
<li class="van-ellipsis van-picker-column__item">17</li>
<li class="van-ellipsis van-picker-column__item">18</li>
<li class="van-ellipsis van-picker-column__item">19</li>
<li class="van-ellipsis van-picker-column__item">20</li>
<li class="van-ellipsis van-picker-column__item">21</li>
<li class="van-ellipsis van-picker-column__item">22</li>
<li class="van-ellipsis van-picker-column__item">23</li>
<li class="van-ellipsis van-picker-column__item">24</li>
<li class="van-ellipsis van-picker-column__item">25</li>
<li class="van-ellipsis van-picker-column__item">26</li>
<li class="van-ellipsis van-picker-column__item">27</li>
<li class="van-ellipsis van-picker-column__item">28</li>
<li class="van-ellipsis van-picker-column__item">29</li>
<li class="van-ellipsis van-picker-column__item">30</li>
<li class="van-ellipsis van-picker-column__item">31</li>
<li class="van-ellipsis van-picker-column__item">32</li>
<li class="van-ellipsis van-picker-column__item">33</li>
<li class="van-ellipsis van-picker-column__item">34</li>
<li class="van-ellipsis van-picker-column__item">35</li>
<li class="van-ellipsis van-picker-column__item">36</li>
<li class="van-ellipsis van-picker-column__item">37</li>
<li class="van-ellipsis van-picker-column__item">38</li>
<li class="van-ellipsis van-picker-column__item">39</li>
<li class="van-ellipsis van-picker-column__item">40</li>
<li class="van-ellipsis van-picker-column__item">41</li>
<li class="van-ellipsis van-picker-column__item">42</li>
<li class="van-ellipsis van-picker-column__item">43</li>
<li class="van-ellipsis van-picker-column__item">44</li>
<li class="van-ellipsis van-picker-column__item">45</li>
<li class="van-ellipsis van-picker-column__item">46</li>
<li class="van-ellipsis van-picker-column__item">47</li>
<li class="van-ellipsis van-picker-column__item">48</li>
<li class="van-ellipsis van-picker-column__item">49</li>
<li class="van-ellipsis van-picker-column__item">50</li>
<li class="van-ellipsis van-picker-column__item">51</li>
<li class="van-ellipsis van-picker-column__item">52</li>
<li class="van-ellipsis van-picker-column__item">53</li>
<li class="van-ellipsis van-picker-column__item">54</li>
<li class="van-ellipsis van-picker-column__item">55</li>
<li class="van-ellipsis van-picker-column__item">56</li>
<li class="van-ellipsis van-picker-column__item">57</li>
<li class="van-ellipsis van-picker-column__item">58</li>
<li class="van-ellipsis van-picker-column__item">59</li>
</ul>
</div>
<div class="van-hairline--top-bottom van-picker__frame" style="height:44px;"></div>
</div>
</div>
</div>
<div>
<div class="van-picker">
<div class="van-hairline--top-bottom van-picker__toolbar">
<div class="van-picker__cancel">取消</div>
<!---->
<div class="van-picker__confirm">确认</div>
</div>
<!---->
<div class="van-picker__columns" style="height:220px;">
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">2018</li>
<li class="van-ellipsis van-picker-column__item">2019</li>
<li class="van-ellipsis van-picker-column__item">2020</li>
<li class="van-ellipsis van-picker-column__item">2021</li>
<li class="van-ellipsis van-picker-column__item">2022</li>
<li class="van-ellipsis van-picker-column__item">2023</li>
<li class="van-ellipsis van-picker-column__item">2024</li>
<li class="van-ellipsis van-picker-column__item">2025</li>
<li class="van-ellipsis van-picker-column__item">2026</li>
<li class="van-ellipsis van-picker-column__item">2027</li>
<li class="van-ellipsis van-picker-column__item">2028</li>
</ul>
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">05</li>
<li class="van-ellipsis van-picker-column__item">06</li>
<li class="van-ellipsis van-picker-column__item">07</li>
<li class="van-ellipsis van-picker-column__item">08</li>
<li class="van-ellipsis van-picker-column__item">09</li>
<li class="van-ellipsis van-picker-column__item">10</li>
<li class="van-ellipsis van-picker-column__item">11</li>
<li class="van-ellipsis van-picker-column__item">12</li>
</ul>
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">12</li>
<li class="van-ellipsis van-picker-column__item">13</li>
<li class="van-ellipsis van-picker-column__item">14</li>
<li class="van-ellipsis van-picker-column__item">15</li>
<li class="van-ellipsis van-picker-column__item">16</li>
<li class="van-ellipsis van-picker-column__item">17</li>
<li class="van-ellipsis van-picker-column__item">18</li>
<li class="van-ellipsis van-picker-column__item">19</li>
<li class="van-ellipsis van-picker-column__item">20</li>
<li class="van-ellipsis van-picker-column__item">21</li>
<li class="van-ellipsis van-picker-column__item">22</li>
<li class="van-ellipsis van-picker-column__item">23</li>
<li class="van-ellipsis van-picker-column__item">24</li>
<li class="van-ellipsis van-picker-column__item">25</li>
<li class="van-ellipsis van-picker-column__item">26</li>
<li class="van-ellipsis van-picker-column__item">27</li>
<li class="van-ellipsis van-picker-column__item">28</li>
<li class="van-ellipsis van-picker-column__item">29</li>
<li class="van-ellipsis van-picker-column__item">30</li>
<li class="van-ellipsis van-picker-column__item">31</li>
</ul>
</div>
<div class="van-hairline--top-bottom van-picker__frame" style="height:44px;"></div>
</div>
</div>
</div>
<div>
<div class="van-picker">
<div class="van-hairline--top-bottom van-picker__toolbar">
<div class="van-picker__cancel">取消</div>
<!---->
<div class="van-picker__confirm">确认</div>
</div>
<!---->
<div class="van-picker__columns" style="height:220px;">
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">2018</li>
<li class="van-ellipsis van-picker-column__item">2019</li>
<li class="van-ellipsis van-picker-column__item">2020</li>
<li class="van-ellipsis van-picker-column__item">2021</li>
<li class="van-ellipsis van-picker-column__item">2022</li>
<li class="van-ellipsis van-picker-column__item">2023</li>
<li class="van-ellipsis van-picker-column__item">2024</li>
<li class="van-ellipsis van-picker-column__item">2025</li>
<li class="van-ellipsis van-picker-column__item">2026</li>
<li class="van-ellipsis van-picker-column__item">2027</li>
<li class="van-ellipsis van-picker-column__item">2028</li>
</ul>
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">05</li>
<li class="van-ellipsis van-picker-column__item">06</li>
<li class="van-ellipsis van-picker-column__item">07</li>
<li class="van-ellipsis van-picker-column__item">08</li>
<li class="van-ellipsis van-picker-column__item">09</li>
<li class="van-ellipsis van-picker-column__item">10</li>
<li class="van-ellipsis van-picker-column__item">11</li>
<li class="van-ellipsis van-picker-column__item">12</li>
</ul>
</div>
<div class="van-hairline--top-bottom van-picker__frame" style="height:44px;"></div>
</div>
</div>
</div>
<div>
<div class="van-picker">
<div class="van-hairline--top-bottom van-picker__toolbar">
<div class="van-picker__cancel">取消</div>
<!---->
<div class="van-picker__confirm">确认</div>
</div>
<!---->
<div class="van-picker__columns" style="height:220px;">
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">10</li>
<li class="van-ellipsis van-picker-column__item">11</li>
<li class="van-ellipsis van-picker-column__item">12</li>
<li class="van-ellipsis van-picker-column__item">13</li>
<li class="van-ellipsis van-picker-column__item">14</li>
<li class="van-ellipsis van-picker-column__item">15</li>
<li class="van-ellipsis van-picker-column__item">16</li>
<li class="van-ellipsis van-picker-column__item">17</li>
<li class="van-ellipsis van-picker-column__item">18</li>
<li class="van-ellipsis van-picker-column__item">19</li>
<li class="van-ellipsis van-picker-column__item">20</li>
</ul>
</div>
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">00</li>
<li class="van-ellipsis van-picker-column__item">01</li>
<li class="van-ellipsis van-picker-column__item">02</li>
<li class="van-ellipsis van-picker-column__item">03</li>
<li class="van-ellipsis van-picker-column__item">04</li>
<li class="van-ellipsis van-picker-column__item">05</li>
<li class="van-ellipsis van-picker-column__item">06</li>
<li class="van-ellipsis van-picker-column__item">07</li>
<li class="van-ellipsis van-picker-column__item">08</li>
<li class="van-ellipsis van-picker-column__item">09</li>
<li class="van-ellipsis van-picker-column__item">10</li>
<li class="van-ellipsis van-picker-column__item">11</li>
<li class="van-ellipsis van-picker-column__item">12</li>
<li class="van-ellipsis van-picker-column__item">13</li>
<li class="van-ellipsis van-picker-column__item">14</li>
<li class="van-ellipsis van-picker-column__item">15</li>
<li class="van-ellipsis van-picker-column__item">16</li>
<li class="van-ellipsis van-picker-column__item">17</li>
<li class="van-ellipsis van-picker-column__item">18</li>
<li class="van-ellipsis van-picker-column__item">19</li>
<li class="van-ellipsis van-picker-column__item">20</li>
<li class="van-ellipsis van-picker-column__item">21</li>
<li class="van-ellipsis van-picker-column__item">22</li>
<li class="van-ellipsis van-picker-column__item">23</li>
<li class="van-ellipsis van-picker-column__item">24</li>
<li class="van-ellipsis van-picker-column__item">25</li>
<li class="van-ellipsis van-picker-column__item">26</li>
<li class="van-ellipsis van-picker-column__item">27</li>
<li class="van-ellipsis van-picker-column__item">28</li>
<li class="van-ellipsis van-picker-column__item">29</li>
<li class="van-ellipsis van-picker-column__item">30</li>
<li class="van-ellipsis van-picker-column__item">31</li>
<li class="van-ellipsis van-picker-column__item">32</li>
<li class="van-ellipsis van-picker-column__item">33</li>
<li class="van-ellipsis van-picker-column__item">34</li>
<li class="van-ellipsis van-picker-column__item">35</li>
<li class="van-ellipsis van-picker-column__item">36</li>
<li class="van-ellipsis van-picker-column__item">37</li>
<li class="van-ellipsis van-picker-column__item">38</li>
<li class="van-ellipsis van-picker-column__item">39</li>
<li class="van-ellipsis van-picker-column__item">40</li>
<li class="van-ellipsis van-picker-column__item">41</li>
<li class="van-ellipsis van-picker-column__item">42</li>
<li class="van-ellipsis van-picker-column__item">43</li>
<li class="van-ellipsis van-picker-column__item">44</li>
<li class="van-ellipsis van-picker-column__item">45</li>
<li class="van-ellipsis van-picker-column__item">46</li>
<li class="van-ellipsis van-picker-column__item">47</li>
<li class="van-ellipsis van-picker-column__item">48</li>
<li class="van-ellipsis van-picker-column__item">49</li>
<li class="van-ellipsis van-picker-column__item">50</li>
<li class="van-ellipsis van-picker-column__item">51</li>
<li class="van-ellipsis van-picker-column__item">52</li>
<li class="van-ellipsis van-picker-column__item">53</li>
<li class="van-ellipsis van-picker-column__item">54</li>
<li class="van-ellipsis van-picker-column__item">55</li>
<li class="van-ellipsis van-picker-column__item">56</li>
<li class="van-ellipsis van-picker-column__item">57</li>
<li class="van-ellipsis van-picker-column__item">58</li>
<li class="van-ellipsis van-picker-column__item">59</li>
</ul>
</div>
<div class="van-hairline--top-bottom van-picker__frame" style="height:44px;"></div>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import DatetimePicker from '../';
import demoTest from '../../../test/demo-test';
demoTest(DatetimePicker);

View File

@ -0,0 +1,61 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders dialog correctly 1`] = `
<div>
<div>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">Alert</span></button>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">无标题 Alert</span></button>
</div>
<div>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">Confirm</span></button>
</div>
<div>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">高级用法</span></button>
<div class="van-dialog" style="display:none;">
<!---->
<div class="van-hairline van-dialog__content">
<div placeholder="请输入用户名" class="van-cell van-hairline van-field">
<!---->
<div class="van-cell__title"><span>用户名</span>
<!---->
</div>
<div class="van-cell__value">
<input type="text" placeholder="请输入用户名" value="" class="van-field__control">
<!---->
<!---->
<!---->
</div>
<!---->
</div>
<div placeholder="请输入密码" class="van-cell van-hairline van-field">
<!---->
<div class="van-cell__title"><span>密码</span>
<!---->
</div>
<div class="van-cell__value">
<input type="password" placeholder="请输入密码" value="" class="van-field__control">
<!---->
<!---->
<!---->
</div>
<!---->
</div>
</div>
<div class="van-dialog__footer van-dialog__footer--buttons">
<button class="van-button van-button--default van-button--large van-dialog__cancel">
<!----><span class="van-button__text">
取消
</span></button>
<button class="van-button van-button--default van-button--large van-dialog__confirm van-hairline--left">
<!----><span class="van-button__text">
确认
</span></button>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,3 @@
import demoTest from '../../../test/demo-test';
demoTest('dialog');

View File

@ -0,0 +1,143 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders field correctly 1`] = `
<div>
<div>
<div class="van-cell-group van-hairline--top-bottom">
<div placeholder="请输入用户名" class="van-cell van-hairline van-field">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">
<input type="text" placeholder="请输入用户名" value="" class="van-field__control">
<!---->
<!---->
<!---->
</div>
<!---->
</div>
</div>
</div>
<div>
<div class="van-cell-group van-hairline--top-bottom">
<div placeholder="请输入用户名" class="van-cell van-cell--required van-hairline van-field van-field--has-icon">
<!---->
<div class="van-cell__title"><span>用户名</span>
<!---->
</div>
<div class="van-cell__value">
<input type="text" placeholder="请输入用户名" value="" class="van-field__control">
<!---->
<div class="van-field__icon" style="display:none;">
<i class="van-icon van-icon-clear" style="color:undefined;">
<!---->
</i>
</div>
<!---->
</div>
<!---->
</div>
<div placeholder="请输入密码" class="van-cell van-cell--required van-hairline van-field">
<!---->
<div class="van-cell__title"><span>密码</span>
<!---->
</div>
<div class="van-cell__value">
<input type="password" placeholder="请输入密码" value="" class="van-field__control">
<!---->
<!---->
<!---->
</div>
<!---->
</div>
</div>
</div>
<div>
<div class="van-cell-group van-hairline--top-bottom">
<div disabled="disabled" class="van-cell van-hairline van-field">
<!---->
<div class="van-cell__title"><span>用户名</span>
<!---->
</div>
<div class="van-cell__value">
<input type="text" disabled="disabled" value="输入框已禁用" class="van-field__control">
<!---->
<!---->
<!---->
</div>
<!---->
</div>
</div>
</div>
<div>
<div class="van-cell-group van-hairline--top-bottom">
<div placeholder="请输入用户名" class="van-cell van-hairline van-field van-field--error">
<!---->
<div class="van-cell__title"><span>用户名</span>
<!---->
</div>
<div class="van-cell__value">
<input type="text" placeholder="请输入用户名" value="" class="van-field__control">
<!---->
<!---->
<!---->
</div>
<!---->
</div>
<div placeholder="请输入手机号" class="van-cell van-hairline van-field">
<!---->
<div class="van-cell__title"><span>手机号</span>
<!---->
</div>
<div class="van-cell__value">
<input type="text" placeholder="请输入手机号" value="1365577" class="van-field__control">
<div class="van-field__error-message">手机号格式错误</div>
<!---->
<!---->
</div>
<!---->
</div>
</div>
</div>
<div>
<div class="van-cell-group van-hairline--top-bottom">
<div placeholder="请输入留言" rows="1" class="van-cell van-hairline van-field">
<!---->
<div class="van-cell__title"><span>留言</span>
<!---->
</div>
<div class="van-cell__value">
<textarea placeholder="请输入留言" rows="1" class="van-field__control"></textarea>
<!---->
<!---->
<!---->
</div>
<!---->
</div>
</div>
</div>
<div>
<div class="van-cell-group van-hairline--top-bottom">
<div placeholder="请输入短信验证码" class="van-cell van-cell--center van-hairline van-field van-field--has-icon">
<!---->
<div class="van-cell__title"><span>短信验证码</span>
<!---->
</div>
<div class="van-cell__value">
<input type="text" placeholder="请输入短信验证码" value="" class="van-field__control">
<!---->
<div class="van-field__icon" style="display:none;">
<i class="van-icon van-icon-clear" style="color:undefined;">
<!---->
</i>
</div>
</div>
<!---->
<div class="van-field__button">
<button class="van-button van-button--primary van-button--small">
<!----><span class="van-button__text">发送验证码</span></button>
</div>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Field from '../';
import demoTest from '../../../test/demo-test';
demoTest(Field);

View File

@ -0,0 +1,42 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders goods-action correctly 1`] = `
<div>
<div>
<div class="van-goods-action">
<a class="van-hairline van-goods-action-mini-btn">
<i class="van-icon van-icon-chat van-goods-action-mini-btn__icon" style="color:undefined;">
<!---->
</i> 客服</a>
<a class="van-hairline van-goods-action-mini-btn">
<i class="van-icon van-icon-cart van-goods-action-mini-btn__icon" style="color:undefined;">
<!---->
</i> 购物车</a>
<a class="van-button van-button--default van-button--normal van-button--bottom-action van-goods-action-big-btn">
<!----><span class="van-button__text">加入购物车</span></a>
<a class="van-button van-button--primary van-button--normal van-button--bottom-action van-goods-action-big-btn">
<!----><span class="van-button__text">立即购买</span></a>
</div>
</div>
<div>
<div class="van-goods-action">
<a class="van-hairline van-goods-action-mini-btn">
<i class="van-icon van-icon-chat van-goods-action-mini-btn__icon" style="color:undefined;">
<!---->
</i> 客服</a>
<a class="van-hairline van-goods-action-mini-btn">
<i class="van-icon van-icon-cart van-goods-action-mini-btn__icon" style="color:undefined;">
<div class="van-icon__info">5</div>
</i> 购物车</a>
<a class="van-hairline van-goods-action-mini-btn">
<i class="van-icon van-icon-shop van-goods-action-mini-btn__icon" style="color:undefined;">
<!---->
</i> 店铺</a>
<a class="van-button van-button--default van-button--normal van-button--bottom-action van-goods-action-big-btn">
<!----><span class="van-button__text">加入购物车</span></a>
<a class="van-button van-button--primary van-button--normal van-button--bottom-action van-goods-action-big-btn">
<!----><span class="van-button__text">立即购买</span></a>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import GoodsAction from '../';
import demoTest from '../../../test/demo-test';
demoTest(GoodsAction);

View File

@ -0,0 +1,388 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders icon correctly 1`] = `
<div>
<div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-close" style="color:undefined;">
<!---->
</i> <span>close</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-upgrade" style="color:undefined;">
<!---->
</i> <span>upgrade</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-add-o" style="color:undefined;">
<!---->
</i> <span>add-o</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-passed" style="color:undefined;">
<!---->
</i> <span>passed</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-chat" style="color:undefined;">
<!---->
</i> <span>chat</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-question" style="color:undefined;">
<!---->
</i> <span>question</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-clock" style="color:undefined;">
<!---->
</i> <span>clock</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-gold-coin" style="color:undefined;">
<!---->
</i> <span>gold-coin</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-play" style="color:undefined;">
<!---->
</i> <span>play</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-pause" style="color:undefined;">
<!---->
</i> <span>pause</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-stop" style="color:undefined;">
<!---->
</i> <span>stop</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-more-o" style="color:undefined;">
<!---->
</i> <span>more-o</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-info-o" style="color:undefined;">
<!---->
</i> <span>info-o</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-share" style="color:undefined;">
<!---->
</i> <span>share</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-like-o" style="color:undefined;">
<!---->
</i> <span>like-o</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-logistics" style="color:undefined;">
<!---->
</i> <span>logistics</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-edit" style="color:undefined;">
<!---->
</i> <span>edit</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-exchange" style="color:undefined;">
<!---->
</i> <span>exchange</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-location" style="color:undefined;">
<!---->
</i> <span>location</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-cart" style="color:undefined;">
<!---->
</i> <span>cart</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-shop" style="color:undefined;">
<!---->
</i> <span>shop</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-gift" style="color:undefined;">
<!---->
</i> <span>gift</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-contact" style="color:undefined;">
<!---->
</i> <span>contact</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-wap-home" style="color:undefined;">
<!---->
</i> <span>wap-home</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-points" style="color:undefined;">
<!---->
</i> <span>points</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-discount" style="color:undefined;">
<!---->
</i> <span>discount</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-point-gift" style="color:undefined;">
<!---->
</i> <span>point-gift</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-after-sale" style="color:undefined;">
<!---->
</i> <span>after-sale</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-edit-data" style="color:undefined;">
<!---->
</i> <span>edit-data</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-delete" style="color:undefined;">
<!---->
</i> <span>delete</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-records" style="color:undefined;">
<!---->
</i> <span>records</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-completed" style="color:undefined;">
<!---->
</i> <span>completed</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-certificate" style="color:undefined;">
<!---->
</i> <span>certificate</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-tosend" style="color:undefined;">
<!---->
</i> <span>tosend</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-sign" style="color:undefined;">
<!---->
</i> <span>sign</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-home" style="color:undefined;">
<!---->
</i> <span>home</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-free-postage" style="color:undefined;">
<!---->
</i> <span>free-postage</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-birthday-privilege" style="color:undefined;">
<!---->
</i> <span>birthday-privilege</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-member-day-privilege" style="color:undefined;">
<!---->
</i> <span>member-day-privilege</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-balance-details" style="color:undefined;">
<!---->
</i> <span>balance-details</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-cash-back-record" style="color:undefined;">
<!---->
</i> <span>cash-back-record</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-points-mall" style="color:undefined;">
<!---->
</i> <span>points-mall</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-exchange-record" style="color:undefined;">
<!---->
</i> <span>exchange-record</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-pending-payment" style="color:undefined;">
<!---->
</i> <span>pending-payment</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-pending-orders" style="color:undefined;">
<!---->
</i> <span>pending-orders</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-pending-deliver" style="color:undefined;">
<!---->
</i> <span>pending-deliver</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-pending-evaluate" style="color:undefined;">
<!---->
</i> <span>pending-evaluate</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-password-view" style="color:undefined;">
<!---->
</i> <span>password-view</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-password-not-view" style="color:undefined;">
<!---->
</i> <span>password-not-view</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-check" style="color:undefined;">
<!---->
</i> <span>check</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-arrow" style="color:undefined;">
<!---->
</i> <span>arrow</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-arrow-left" style="color:undefined;">
<!---->
</i> <span>arrow-left</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-search" style="color:undefined;">
<!---->
</i> <span>search</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-success" style="color:undefined;">
<!---->
</i> <span>success</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-fail" style="color:undefined;">
<!---->
</i> <span>fail</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-add" style="color:undefined;">
<!---->
</i> <span>add</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-checked" style="color:undefined;">
<!---->
</i> <span>checked</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-warn" style="color:undefined;">
<!---->
</i> <span>warn</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-clear" style="color:undefined;">
<!---->
</i> <span>clear</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-underway" style="color:undefined;">
<!---->
</i> <span>underway</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-more" style="color:undefined;">
<!---->
</i> <span>more</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-like" style="color:undefined;">
<!---->
</i> <span>like</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-photograph" style="color:undefined;">
<!---->
</i> <span>photograph</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-qr-invalid" style="color:undefined;">
<!---->
</i> <span>qr-invalid</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-qr" style="color:undefined;">
<!---->
</i> <span>qr</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-add2" style="color:undefined;">
<!---->
</i> <span>add2</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-photo" style="color:undefined;">
<!---->
</i> <span>photo</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-wechat" style="color:undefined;">
<!---->
</i> <span>wechat</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-alipay" style="color:undefined;">
<!---->
</i> <span>alipay</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-wap-nav" style="color:undefined;">
<!---->
</i> <span>wap-nav</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-ecard-pay" style="color:undefined;">
<!---->
</i> <span>ecard-pay</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-balance-pay" style="color:undefined;">
<!---->
</i> <span>balance-pay</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-peer-pay" style="color:undefined;">
<!---->
</i> <span>peer-pay</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-credit-pay" style="color:undefined;">
<!---->
</i> <span>credit-pay</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-debit-pay" style="color:undefined;">
<!---->
</i> <span>debit-pay</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-other-pay" style="color:undefined;">
<!---->
</i> <span>other-pay</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-shopping-cart" style="color:undefined;">
<!---->
</i> <span>shopping-cart</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-browsing-history" style="color:undefined;">
<!---->
</i> <span>browsing-history</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-goods-collect" style="color:undefined;">
<!---->
</i> <span>goods-collect</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-shop-collect" style="color:undefined;">
<!---->
</i> <span>shop-collect</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-receive-gift" style="color:undefined;">
<!---->
</i> <span>receive-gift</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-send-gift" style="color:undefined;">
<!---->
</i> <span>send-gift</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-setting" style="color:undefined;">
<!---->
</i> <span>setting</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-coupon" style="color:undefined;">
<!---->
</i> <span>coupon</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-gift-card-pay" style="color:undefined;">
<!---->
</i> <span>gift-card-pay</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-cash-on-deliver" style="color:undefined;">
<!---->
</i> <span>cash-on-deliver</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-phone" style="color:undefined;">
<!---->
</i> <span>phone</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-description" style="color:undefined;">
<!---->
</i> <span>description</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-card" style="color:undefined;">
<!---->
</i> <span>card</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-value-card" style="color:undefined;">
<!---->
</i> <span>value-card</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-gift-card" style="color:undefined;">
<!---->
</i> <span>gift-card</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-hot" style="color:undefined;">
<!---->
</i> <span>hot</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-new" style="color:undefined;">
<!---->
</i> <span>new</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-new-arrival" style="color:undefined;">
<!---->
</i> <span>new-arrival</span></div>
<div class="van-col van-col-8">
<i class="van-icon van-icon-hot-sale" style="color:undefined;">
<!---->
</i> <span>hot-sale</span></div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Icon from '../';
import demoTest from '../../../test/demo-test';
demoTest(Icon);

View File

@ -0,0 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders list correctly 1`] = `
<div>
<div>
<p class="page-desc">当即将滚动到元素底部时,会自动加载更多</p>
<div class="van-pull-refresh">
<div class="van-pull-refresh__track" style="transition:0ms;transform:translate3d(0,0px, 0);">
<div class="van-pull-refresh__head">
<!---->
<!---->
<!---->
</div>
<div class="van-list">
<div class="van-list__loading" style="display:none;">
<div class="van-loading van-loading--circular van-loading--black"><span class="van-loading__spinner van-loading__spinner--circular"> <svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div> <span class="van-list__loading-text">加载中...</span></div>
</div>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import List from '../';
import demoTest from '../../../test/demo-test';
demoTest(List);

View File

@ -0,0 +1,14 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders loading correctly 1`] = `
<div>
<div>
<div class="van-loading van-loading--circular van-loading--black"><span class="van-loading__spinner van-loading__spinner--circular"> <svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div>
<div class="van-loading van-loading--circular van-loading--white"><span class="van-loading__spinner van-loading__spinner--circular"> <svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div>
</div>
<div>
<div class="van-loading van-loading--spinner van-loading--black"><span class="van-loading__spinner van-loading__spinner--spinner"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i> <!----></span></div>
<div class="van-loading van-loading--spinner van-loading--white"><span class="van-loading__spinner van-loading__spinner--spinner"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i> <!----></span></div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Loading from '../';
import demoTest from '../../../test/demo-test';
demoTest(Loading);

View File

@ -0,0 +1,30 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders nav-bar correctly 1`] = `
<div>
<div>
<div class="van-hairline--bottom van-nav-bar" style="z-index:1;">
<div class="van-nav-bar__left">
<i class="van-icon van-icon-arrow van-nav-bar__arrow" style="color:undefined;">
<!---->
</i> <span class="van-nav-bar__text">返回</span></div>
<div class="van-ellipsis van-nav-bar__title">标题</div>
<div class="van-nav-bar__right"><span class="van-nav-bar__text">按钮</span></div>
</div>
</div>
<div>
<div class="van-hairline--bottom van-nav-bar" style="z-index:1;">
<div class="van-nav-bar__left">
<i class="van-icon van-icon-arrow van-nav-bar__arrow" style="color:undefined;">
<!---->
</i> <span class="van-nav-bar__text">返回</span></div>
<div class="van-ellipsis van-nav-bar__title">标题</div>
<div class="van-nav-bar__right">
<i class="van-icon van-icon-search" style="color:undefined;">
<!---->
</i>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import NavBar from '../';
import demoTest from '../../../test/demo-test';
demoTest(NavBar);

View File

@ -0,0 +1,46 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders notice-bar correctly 1`] = `
<div>
<div>
<div class="van-notice-bar" style="color:undefined;background:undefined;">
<div class="van-notice-bar__left-icon">
<img src="//img.yzcdn.cn/public_files/2017/8/10/6af5b7168eed548100d9041f07b7c616.png">
</div>
<div class="van-notice-bar__wrap">
<div class="van-notice-bar__content" style="padding-left:0;animation-delay:1s;animation-duration:0s;">足协杯战线连续第2年上演广州德比战上赛季半决赛上恒大以两回合5-3的总比分淘汰富力。</div>
</div>
<!---->
</div>
</div>
<div>
<div class="van-notice-bar" style="color:undefined;background:undefined;">
<!---->
<div class="van-notice-bar__wrap">
<div class="van-notice-bar__content" style="padding-left:0;animation-delay:1s;animation-duration:0s;">足协杯战线连续第2年上演广州德比战上赛季半决赛上恒大以两回合5-3的总比分淘汰富力。</div>
</div>
<!---->
</div>
</div>
<div>
<div class="van-notice-bar van-notice-bar--withicon" style="color:undefined;background:undefined;">
<!---->
<div class="van-notice-bar__wrap">
<div class="van-notice-bar__content" style="padding-left:0;animation-delay:1s;animation-duration:0s;">足协杯战线连续第2年上演广州德比战上赛季半决赛上恒大以两回合5-3的总比分淘汰富力。</div>
</div>
<i class="van-icon van-icon-close van-notice-bar__right-icon" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-notice-bar van-notice-bar--withicon" style="color:undefined;background:undefined;">
<!---->
<div class="van-notice-bar__wrap">
<div class="van-notice-bar__content" style="padding-left:0;animation-delay:1s;animation-duration:0s;">足协杯战线连续第2年上演广州德比战上赛季半决赛上恒大以两回合5-3的总比分淘汰富力。</div>
</div>
<i class="van-icon van-icon-arrow van-notice-bar__right-icon" style="color:undefined;">
<!---->
</i>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import NoticeBar from '../';
import demoTest from '../../../test/demo-test';
demoTest(NoticeBar);

View File

@ -0,0 +1,56 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders number-keyboard correctly 1`] = `
<div>
<div>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">
弹出默认键盘
</span></button>
<div class="van-number-keyboard van-number-keyboard--default" style="z-index:100;">
<div class="van-hairline--top van-number-keyboard__title"><span></span> <span class="van-number-keyboard__close">完成</span></div>
<div class="van-number-keyboard__body">
<i class="van-hairline van-key">1</i>
<i class="van-hairline van-key">2</i>
<i class="van-hairline van-key">3</i>
<i class="van-hairline van-key">4</i>
<i class="van-hairline van-key">5</i>
<i class="van-hairline van-key">6</i>
<i class="van-hairline van-key">7</i>
<i class="van-hairline van-key">8</i>
<i class="van-hairline van-key">9</i>
<i class="van-hairline van-key van-key van-key--gray">.</i>
<i class="van-hairline van-key">0</i>
<i class="van-hairline van-key van-key van-key--gray van-key van-key--delete">delete</i>
</div>
<!---->
</div>
</div>
<div>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">
弹出自定义键盘
</span></button>
<div class="van-number-keyboard van-number-keyboard--custom" style="z-index:100;display:none;">
<!---->
<div class="van-number-keyboard__body">
<i class="van-hairline van-key">1</i>
<i class="van-hairline van-key">2</i>
<i class="van-hairline van-key">3</i>
<i class="van-hairline van-key">4</i>
<i class="van-hairline van-key">5</i>
<i class="van-hairline van-key">6</i>
<i class="van-hairline van-key">7</i>
<i class="van-hairline van-key">8</i>
<i class="van-hairline van-key">9</i>
<i class="van-hairline van-key van-key van-key--middle">0</i>
<i class="van-hairline van-key">.</i>
</div>
<div class="van-number-keyboard__sidebar">
<i class="van-hairline van-key van-key van-key--delete van-key van-key--big">delete</i>
<i class="van-hairline van-key van-key van-key--green van-key van-key--big">完成</i>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import NumberKeyboard from '../';
import demoTest from '../../../test/demo-test';
demoTest(NumberKeyboard);

View File

@ -0,0 +1,71 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders pagination correctly 1`] = `
<div>
<div>
<ul previous-text="上一页" class="van-pagination">
<li class="van-hairline van-pagination__item van-pagination__item--disabled van-pagination__prev">
上一页
</li>
<li class="van-hairline van-pagination__item van-pagination__item--active van-pagination__page">
1
</li>
<li class="van-hairline van-pagination__item van-pagination__page">
2
</li>
<li class="van-hairline van-pagination__item van-pagination__page">
3
</li>
<li class="van-hairline van-pagination__item van-pagination__page">
4
</li>
<li class="van-hairline van-pagination__item van-pagination__page">
5
</li>
<!---->
<li class="van-hairline van-pagination__item van-pagination__next">
下一页
</li>
</ul>
</div>
<div>
<ul previous-text="上一页" size="small" class="van-pagination van-pagination--simple">
<li class="van-hairline van-pagination__item van-pagination__item--disabled van-pagination__prev">
上一页
</li>
<!---->
<!---->
<!---->
<!---->
<!---->
<li class="van-pagination__page-desc">1/12</li>
<li class="van-hairline van-pagination__item van-pagination__next">
下一页
</li>
</ul>
</div>
<div>
<ul previous-text="上一页" class="van-pagination">
<li class="van-hairline van-pagination__item van-pagination__item--disabled van-pagination__prev">
上一页
</li>
<li class="van-hairline van-pagination__item van-pagination__item--active van-pagination__page">
1
</li>
<li class="van-hairline van-pagination__item van-pagination__page">
2
</li>
<li class="van-hairline van-pagination__item van-pagination__page">
3
</li>
<li class="van-hairline van-pagination__item van-pagination__page">
...
</li>
<!---->
<li class="van-hairline van-pagination__item van-pagination__next">
下一页
</li>
</ul>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Pagination from '../';
import demoTest from '../../../test/demo-test';
demoTest(Pagination);

View File

@ -0,0 +1,45 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders panel correctly 1`] = `
<div>
<div>
<div class="van-cell-group van-hairline--top-bottom van-panel">
<div class="van-cell van-hairline van-panel__header">
<!---->
<div class="van-cell__title"><span>标题</span>
<div class="van-cell__label">描述信息</div>
</div>
<div class="van-cell__value"><span>状态</span></div>
<!---->
</div>
<div class="van-panel__content">
<div>内容</div>
</div>
<!---->
</div>
</div>
<div>
<div class="van-cell-group van-hairline--top-bottom van-panel">
<div class="van-cell van-hairline van-panel__header">
<!---->
<div class="van-cell__title"><span>标题</span>
<div class="van-cell__label">描述信息</div>
</div>
<div class="van-cell__value"><span>状态</span></div>
<!---->
</div>
<div class="van-panel__content">
<div>内容</div>
</div>
<div class="van-hairline--top van-panel__footer">
<div>
<button class="van-button van-button--default van-button--small">
<!----><span class="van-button__text">按钮</span></button>
<button class="van-button van-button--danger van-button--small">
<!----><span class="van-button__text">按钮</span></button>
</div>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Panel from '../';
import demoTest from '../../../test/demo-test';
demoTest(Panel);

View File

@ -0,0 +1,49 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders password-input correctly 1`] = `
<div>
<div>
<div class="van-password-input">
<ul class="van-hairline--surround van-password-input__security">
<li class="van-hairline">
<i style="visibility:visible;"></i>
</li>
<li class="van-hairline">
<i style="visibility:visible;"></i>
</li>
<li class="van-hairline">
<i style="visibility:visible;"></i>
</li>
<li class="van-hairline">
<i style="visibility:hidden;"></i>
</li>
<li class="van-hairline">
<i style="visibility:hidden;"></i>
</li>
<li class="van-hairline">
<i style="visibility:hidden;"></i>
</li>
</ul>
<div class="van-password-input__info">密码为 6 位数字</div>
</div>
<div class="van-number-keyboard van-number-keyboard--default" style="z-index:100;">
<!---->
<div class="van-number-keyboard__body">
<i class="van-hairline van-key">1</i>
<i class="van-hairline van-key">2</i>
<i class="van-hairline van-key">3</i>
<i class="van-hairline van-key">4</i>
<i class="van-hairline van-key">5</i>
<i class="van-hairline van-key">6</i>
<i class="van-hairline van-key">7</i>
<i class="van-hairline van-key">8</i>
<i class="van-hairline van-key">9</i>
<i class="van-hairline van-key van-key van-key--gray"></i>
<i class="van-hairline van-key">0</i>
<i class="van-hairline van-key van-key van-key--gray van-key van-key--delete">delete</i>
</div>
<!---->
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import PasswordInput from '../';
import demoTest from '../../../test/demo-test';
demoTest(PasswordInput);

View File

@ -0,0 +1,112 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders picker correctly 1`] = `
<div>
<div>
<div class="van-picker">
<!---->
<!---->
<div class="van-picker__columns" style="height:220px;">
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">杭州</li>
<li class="van-ellipsis van-picker-column__item">宁波</li>
<li class="van-ellipsis van-picker-column__item">温州</li>
<li class="van-ellipsis van-picker-column__item">嘉兴</li>
<li class="van-ellipsis van-picker-column__item">湖州</li>
</ul>
</div>
<div class="van-hairline--top-bottom van-picker__frame" style="height:44px;"></div>
</div>
</div>
</div>
<div>
<div class="van-picker">
<!---->
<!---->
<div class="van-picker__columns" style="height:220px;">
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--disabled van-picker-column__item--selected">杭州</li>
<li class="van-ellipsis van-picker-column__item">宁波</li>
<li class="van-ellipsis van-picker-column__item">温州</li>
</ul>
</div>
<div class="van-hairline--top-bottom van-picker__frame" style="height:44px;"></div>
</div>
</div>
</div>
<div>
<div class="van-picker">
<div class="van-hairline--top-bottom van-picker__toolbar">
<div class="van-picker__cancel">取消</div>
<div class="van-ellipsis van-picker__title">标题</div>
<div class="van-picker__confirm">确认</div>
</div>
<!---->
<div class="van-picker__columns" style="height:220px;">
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">杭州</li>
<li class="van-ellipsis van-picker-column__item">宁波</li>
<li class="van-ellipsis van-picker-column__item">温州</li>
<li class="van-ellipsis van-picker-column__item">嘉兴</li>
<li class="van-ellipsis van-picker-column__item">湖州</li>
</ul>
</div>
<div class="van-hairline--top-bottom van-picker__frame" style="height:44px;"></div>
</div>
</div>
</div>
<div>
<div class="van-picker">
<!---->
<!---->
<div class="van-picker__columns" style="height:220px;">
<div class="van-picker-column column1" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">浙江</li>
<li class="van-ellipsis van-picker-column__item">福建</li>
</ul>
</div>
<div class="van-picker-column column2" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item">杭州</li>
<li class="van-ellipsis van-picker-column__item">宁波</li>
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">温州</li>
<li class="van-ellipsis van-picker-column__item">嘉兴</li>
<li class="van-ellipsis van-picker-column__item">湖州</li>
</ul>
</div>
<div class="van-hairline--top-bottom van-picker__frame" style="height:44px;"></div>
</div>
</div>
</div>
<div>
<div class="van-picker">
<!---->
<div class="van-picker__loading">
<div class="van-loading van-loading--circular van-loading--black"><span class="van-loading__spinner van-loading__spinner--circular"> <svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div>
</div>
<div class="van-picker__columns" style="height:220px;">
<div class="van-picker-column column1" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">浙江</li>
<li class="van-ellipsis van-picker-column__item">福建</li>
</ul>
</div>
<div class="van-picker-column column2" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item">杭州</li>
<li class="van-ellipsis van-picker-column__item">宁波</li>
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">温州</li>
<li class="van-ellipsis van-picker-column__item">嘉兴</li>
<li class="van-ellipsis van-picker-column__item">湖州</li>
</ul>
</div>
<div class="van-hairline--top-bottom van-picker__frame" style="height:44px;"></div>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Picker from '../';
import demoTest from '../../../test/demo-test';
demoTest(Picker);

View File

@ -0,0 +1,54 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders popup correctly 1`] = `
<div>
<div>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">弹出 Popup</span></button>
<div class="van-popup" style="display:none;">内容</div>
</div>
<div>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">底部弹出</span></button>
<div class="van-popup van-popup--bottom" style="display:none;">
<div class="van-picker">
<div class="van-hairline--top-bottom van-picker__toolbar">
<div class="van-picker__cancel">取消</div>
<!---->
<div class="van-picker__confirm">确认</div>
</div>
<!---->
<div class="van-picker__columns" style="height:220px;">
<div class="van-picker-column" style="height:220px;">
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
<li class="van-ellipsis van-picker-column__item van-picker-column__item--selected">杭州</li>
<li class="van-ellipsis van-picker-column__item">宁波</li>
<li class="van-ellipsis van-picker-column__item">温州</li>
<li class="van-ellipsis van-picker-column__item">嘉兴</li>
<li class="van-ellipsis van-picker-column__item">湖州</li>
</ul>
</div>
<div class="van-hairline--top-bottom van-picker__frame" style="height:44px;"></div>
</div>
</div>
</div>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">顶部弹出</span></button>
<div class="van-popup van-popup--top" style="display:none;">
内容
</div>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">右侧弹出</span></button>
<div class="van-popup van-popup--right" style="display:none;">
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">关闭弹层</span></button>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">右侧弹出</span></button>
<div class="van-popup van-popup--right" style="display:none;">
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">关闭弹层</span></button>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Popup from '../';
import demoTest from '../../../test/demo-test';
demoTest(Popup);

View File

@ -0,0 +1,21 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders progress correctly 1`] = `
<div>
<div>
<div class="van-progress"><span class="van-progress__portion" style="width:0%;background-color:#38f;"></span> <span class="van-progress__pivot" style="color:#fff;background-color:#38f;left:0%;margin-left:0;">0%</span></div>
<div class="van-progress"><span class="van-progress__portion" style="width:46%;background-color:#38f;"></span> <span class="van-progress__pivot" style="color:#fff;background-color:#38f;left:46%;margin-left:-14px;">46%</span></div>
<div class="van-progress"><span class="van-progress__portion" style="width:100%;background-color:#38f;"></span> <span class="van-progress__pivot" style="color:#fff;background-color:#38f;left:100%;margin-left:-28px;">100%</span></div>
</div>
<div>
<div class="van-progress"><span class="van-progress__portion" style="width:0%;background-color:#cacaca;"></span> <span class="van-progress__pivot" style="color:#fff;background-color:#cacaca;left:0%;margin-left:0;">0%</span></div>
<div class="van-progress"><span class="van-progress__portion" style="width:46%;background-color:#cacaca;"></span> <span class="van-progress__pivot" style="color:#fff;background-color:#cacaca;left:46%;margin-left:-14px;">46%</span></div>
<div class="van-progress"><span class="van-progress__portion" style="width:100%;background-color:#cacaca;"></span> <span class="van-progress__pivot" style="color:#fff;background-color:#cacaca;left:100%;margin-left:-28px;">100%</span></div>
</div>
<div>
<div class="van-progress"><span class="van-progress__portion" style="width:26%;background-color:#ed5050;"></span> <span class="van-progress__pivot" style="color:#fff;background-color:#ed5050;left:26%;margin-left:-14px;">红色</span></div>
<div class="van-progress"><span class="van-progress__portion" style="width:46%;background-color:#f60;"></span> <span class="van-progress__pivot" style="color:#fff;background-color:#f60;left:46%;margin-left:-14px;">橙色</span></div>
<div class="van-progress"><span class="van-progress__portion" style="width:66%;background-color:#f09000;"></span> <span class="van-progress__pivot" style="color:#fff;background-color:#f09000;left:66%;margin-left:-14px;">黄色</span></div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Progress from '../';
import demoTest from '../../../test/demo-test';
demoTest(Progress);

View File

@ -0,0 +1,18 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders pull-refresh correctly 1`] = `
<div>
<div class="van-pull-refresh">
<div class="van-pull-refresh__track" style="transition:0ms;transform:translate3d(0,0px, 0);">
<div class="van-pull-refresh__head">
<!---->
<!---->
<!---->
</div>
<div>
<p>刷新次数: 0</p>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import PullRefresh from '../';
import demoTest from '../../../test/demo-test';
demoTest(PullRefresh);

View File

@ -0,0 +1,48 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders radio correctly 1`] = `
<div>
<div>
<div class="demo-radio-group van-radio-group">
<div class="van-radio"><span class="van-radio__input"><input type="radio" value="1" checked="checked" class="van-radio__control"> <i class="van-icon van-icon-checked" style="color:undefined;"> <!----></i></span> <span class="van-radio__label">单选框 1</span></div>
<div class="van-radio"><span class="van-radio__input"><input type="radio" value="2" class="van-radio__control"> <i class="van-icon van-icon-check" style="color:undefined;"> <!----></i></span> <span class="van-radio__label">单选框 2</span></div>
</div>
</div>
<div>
<div class="demo-radio-group van-radio-group">
<div class="van-radio van-radio--disabled"><span class="van-radio__input"><input type="radio" disabled="disabled" value="1" class="van-radio__control"> <i class="van-icon van-icon-check" style="color:undefined;"> <!----></i></span> <span class="van-radio__label">单选框 1</span></div>
<div class="van-radio van-radio--disabled"><span class="van-radio__input"><input type="radio" disabled="disabled" value="2" checked="checked" class="van-radio__control"> <i class="van-icon van-icon-checked" style="color:undefined;"> <!----></i></span> <span class="van-radio__label">单选框 2</span></div>
</div>
</div>
<div>
<div class="van-radio-group">
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-cell--clickable van-hairline">
<!---->
<div class="van-cell__title"><span>单选框1</span>
<!---->
</div>
<div class="van-cell__value">
<div class="van-radio"><span class="van-radio__input"><input type="radio" value="1" checked="checked" class="van-radio__control"> <i class="van-icon van-icon-checked" style="color:undefined;"> <!----></i></span>
<!---->
</div>
</div>
<!---->
</div>
<div class="van-cell van-cell--clickable van-hairline">
<!---->
<div class="van-cell__title"><span>单选框2</span>
<!---->
</div>
<div class="van-cell__value">
<div class="van-radio"><span class="van-radio__input"><input type="radio" value="2" class="van-radio__control"> <i class="van-icon van-icon-check" style="color:undefined;"> <!----></i></span>
<!---->
</div>
</div>
<!---->
</div>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Radio from '../';
import demoTest from '../../../test/demo-test';
demoTest(Radio);

View File

@ -0,0 +1,81 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders search correctly 1`] = `
<div>
<div>
<div class="van-search" style="background:#f2f2f2;">
<i class="van-icon van-icon-search" style="color:undefined;">
<!---->
</i>
<div placeholder="请输入商品名称" class="van-cell van-field van-field--has-icon">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">
<input type="search" placeholder="请输入商品名称" value="" class="van-field__control">
<!---->
<div class="van-field__icon" style="display:none;">
<i class="van-icon van-icon-clear" style="color:undefined;">
<!---->
</i>
</div>
<!---->
</div>
<!---->
</div>
<!---->
</div>
</div>
<div>
<form action="/">
<div class="van-search van-search--show-action" style="background:#f2f2f2;">
<i class="van-icon van-icon-search" style="color:undefined;">
<!---->
</i>
<div placeholder="请输入商品名称" class="van-cell van-field van-field--has-icon">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">
<input type="search" placeholder="请输入商品名称" value="" class="van-field__control">
<!---->
<div class="van-field__icon" style="display:none;">
<i class="van-icon van-icon-clear" style="color:undefined;">
<!---->
</i>
</div>
<!---->
</div>
<!---->
</div>
<div class="van-search__action">
<div class="van-search__cancel">取消</div>
</div>
</div>
</form>
</div>
<div>
<div class="van-search van-search--show-action" style="background:#f2f2f2;">
<i class="van-icon van-icon-search" style="color:undefined;">
<!---->
</i>
<div class="van-cell van-field van-field--has-icon">
<!---->
<!---->
<div class="van-cell__value van-cell__value--alone">
<input type="search" value="" class="van-field__control">
<!---->
<div class="van-field__icon" style="display:none;">
<i class="van-icon van-icon-clear" style="color:undefined;">
<!---->
</i>
</div>
<!---->
</div>
<!---->
</div>
<div class="van-search__action">
<div>搜索</div>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Search from '../';
import demoTest from '../../../test/demo-test';
demoTest(Search);

View File

@ -0,0 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders sku correctly 1`] = `""`;

View File

@ -0,0 +1,4 @@
import Sku from '../';
import demoTest from '../../../test/demo-test';
demoTest(Sku);

View File

@ -0,0 +1,26 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders slider correctly 1`] = `
<div>
<div>
<div class="van-slider">
<div class="van-slider__bar" style="width:50%;height:2px;"><span class="van-slider__button"></span></div>
</div>
</div>
<div>
<div class="van-slider">
<div class="van-slider__bar" style="width:50%;height:2px;"><span class="van-slider__button"></span></div>
</div>
</div>
<div>
<div class="van-slider van-slider--disabled">
<div class="van-slider__bar" style="width:50%;height:2px;"><span class="van-slider__button"></span></div>
</div>
</div>
<div>
<div class="van-slider">
<div class="van-slider__bar" style="width:50%;height:4px;"><span class="van-slider__button"></span></div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Slider from '../';
import demoTest from '../../../test/demo-test';
demoTest(Slider);

View File

@ -0,0 +1,27 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders stepper correctly 1`] = `
<div>
<div>
<div class="van-stepper">
<button class="van-stepper__minus van-stepper__minus--disabled"></button>
<input type="number" value="1" class="van-stepper__input">
<button class="van-stepper__plus"></button>
</div>
</div>
<div>
<div class="van-stepper">
<button class="van-stepper__minus van-stepper__minus--disabled"></button>
<input type="number" disabled="disabled" value="1" class="van-stepper__input">
<button class="van-stepper__plus van-stepper__plus--disabled"></button>
</div>
</div>
<div>
<div class="van-stepper">
<button class="van-stepper__minus"></button>
<input type="number" value="9" class="van-stepper__input">
<button class="van-stepper__plus"></button>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Stepper from '../';
import demoTest from '../../../test/demo-test';
demoTest(Stepper);

View File

@ -0,0 +1,131 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders steps correctly 1`] = `
<div>
<div>
<div class="van-steps van-steps--horizontal">
<!---->
<div class="van-steps__items van-steps__items--alone">
<div class="van-hairline van-step van-step--horizontal van-step--finish">
<div class="van-step__title">买家下单</div>
<div class="van-step__circle-container">
<i class="van-step__circle"></i>
</div>
<div class="van-step__line"></div>
</div>
<div class="van-hairline van-step van-step--horizontal van-step--process">
<div class="van-step__title" style="color:#06bf04;">商家接单</div>
<div class="van-step__circle-container">
<i class="van-icon van-icon-checked" style="color:#06bf04;">
<!---->
</i>
</div>
<div class="van-step__line"></div>
</div>
<div class="van-hairline van-step van-step--horizontal">
<div class="van-step__title">买家提货</div>
<div class="van-step__circle-container">
<i class="van-step__circle"></i>
</div>
<div class="van-step__line"></div>
</div>
<div class="van-hairline van-step van-step--horizontal">
<div class="van-step__title">交易完成</div>
<div class="van-step__circle-container">
<i class="van-step__circle"></i>
</div>
<div class="van-step__line"></div>
</div>
</div>
</div>
<button class="van-button van-button--default van-button--normal">
<!----><span class="van-button__text">下一步</span></button>
</div>
<div>
<div class="van-steps van-steps--horizontal">
<div class="van-steps__status">
<div class="van-steps__icon">
<i class="van-icon van-icon-logistics steps-success" style="color:undefined;">
<!---->
</i>
</div>
<div class="van-steps__message">
<div class="van-steps__title">标题</div>
<div class="van-ellipsis van-steps__desc">描述信息</div>
</div>
</div>
<div class="van-steps__items">
<div class="van-hairline van-step van-step--horizontal van-step--finish">
<div class="van-step__title">买家下单</div>
<div class="van-step__circle-container">
<i class="van-step__circle"></i>
</div>
<div class="van-step__line"></div>
</div>
<div class="van-hairline van-step van-step--horizontal van-step--process">
<div class="van-step__title" style="color:#06bf04;">商家接单</div>
<div class="van-step__circle-container">
<i class="van-icon van-icon-checked" style="color:#06bf04;">
<!---->
</i>
</div>
<div class="van-step__line"></div>
</div>
<div class="van-hairline van-step van-step--horizontal">
<div class="van-step__title">买家提货</div>
<div class="van-step__circle-container">
<i class="van-step__circle"></i>
</div>
<div class="van-step__line"></div>
</div>
<div class="van-hairline van-step van-step--horizontal">
<div class="van-step__title">交易完成</div>
<div class="van-step__circle-container">
<i class="van-step__circle"></i>
</div>
<div class="van-step__line"></div>
</div>
</div>
</div>
</div>
<div>
<div class="van-steps van-steps--vertical">
<!---->
<div class="van-steps__items van-steps__items--alone">
<div class="van-hairline van-step van-step--vertical van-step--process">
<div class="van-step__title" style="color:#f60;">
<h3>【城市】物流状态1</h3>
<p>2016-07-12 12:40</p>
</div>
<div class="van-step__circle-container">
<i class="van-icon van-icon-checked" style="color:#f60;">
<!---->
</i>
</div>
<div class="van-step__line"></div>
</div>
<div class="van-hairline van-step van-step--vertical">
<div class="van-step__title">
<h3>【城市】物流状态</h3>
<p>2016-07-11 10:00</p>
</div>
<div class="van-step__circle-container">
<i class="van-step__circle"></i>
</div>
<div class="van-step__line"></div>
</div>
<div class="van-hairline van-step van-step--vertical">
<div class="van-step__title">
<h3>快件已发货</h3>
<p>2016-07-10 09:30</p>
</div>
<div class="van-step__circle-container">
<i class="van-step__circle"></i>
</div>
<div class="van-step__line"></div>
</div>
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Steps from '../';
import demoTest from '../../../test/demo-test';
demoTest(Steps);

View File

@ -12,7 +12,7 @@
<span :class="b('price-decimal')">{{ priceDecimal }}</span> <span :class="b('price-decimal')">{{ priceDecimal }}</span>
</template> </template>
</div> </div>
<van-button :type="buttonType" :disabled="disabled" :loading="loading" @click="onSubmit"> <van-button :type="buttonType" :disabled="disabled" :loading="loading" @click="$emit('submit')">
{{ loading ? '' : buttonText }} {{ loading ? '' : buttonText }}
</van-button> </van-button>
</div> </div>
@ -59,14 +59,6 @@ export default create({
const decimal = Math.floor(this.price % 100); const decimal = Math.floor(this.price % 100);
return (decimal < 10 ? '0' : '') + decimal; return (decimal < 10 ? '0' : '') + decimal;
} }
},
methods: {
onSubmit() {
if (!this.disabled && !this.loading) {
this.$emit('submit');
}
}
} }
}); });
</script> </script>

View File

@ -0,0 +1,78 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders submit-bar correctly 1`] = `
<div>
<div>
<div class="van-submit-bar">
<div class="van-submit-bar__tip" style="display:none;">
</div>
<div class="van-submit-bar__bar">
<div class="van-submit-bar__price"><span>合计:</span> <span class="van-submit-bar__price-integer">¥30.</span> <span class="van-submit-bar__price-decimal">50</span></div>
<button class="van-button van-button--danger van-button--normal">
<!----><span class="van-button__text">
提交订单
</span></button>
</div>
</div>
</div>
<div>
<div class="van-submit-bar">
<div class="van-submit-bar__tip">
您的收货地址不支持同城送, 我们已为您推荐快递</div>
<div class="van-submit-bar__bar">
<div class="van-submit-bar__price"><span>合计:</span> <span class="van-submit-bar__price-integer">¥30.</span> <span class="van-submit-bar__price-decimal">50</span></div>
<button disabled="disabled" class="van-button van-button--danger van-button--normal van-button--disabled van-button--unclickable">
<!----><span class="van-button__text">
提交订单
</span></button>
</div>
</div>
</div>
<div>
<div class="van-submit-bar">
<div class="van-submit-bar__tip" style="display:none;">
</div>
<div class="van-submit-bar__bar">
<div class="van-submit-bar__price"><span>合计:</span> <span class="van-submit-bar__price-integer">¥30.</span> <span class="van-submit-bar__price-decimal">50</span></div>
<button class="van-button van-button--danger van-button--normal van-button--loading van-button--unclickable">
<div class="van-loading van-loading--circular van-loading--white" style="width:20px;height:20px;"><span class="van-loading__spinner van-loading__spinner--circular"> <svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div> <span class="van-button__text">
</span></button>
</div>
</div>
</div>
<div>
<div class="van-submit-bar">
<div class="van-submit-bar__tip">
<span>
您的收货地址不支持同城送, <span class="van-edit-address">修改地址</span></span>
</div>
<div class="van-submit-bar__bar">
<div class="van-checkbox">
<i class="van-icon van-icon-success van-checkbox__icon van-checkbox--round van-checkbox--checked" style="color:undefined;">
<!---->
</i> <span class="van-checkbox__label">全选</span></div>
<div class="van-submit-bar__price"><span>合计:</span> <span class="van-submit-bar__price-integer">¥30.</span> <span class="van-submit-bar__price-decimal">50</span></div>
<button class="van-button van-button--danger van-button--normal">
<!----><span class="van-button__text">
提交订单
</span></button>
</div>
</div>
</div>
</div>
`;
exports[`submit 1`] = `
<div class="van-submit-bar">
<div class="van-submit-bar__tip" style="display: none;">
</div>
<div class="van-submit-bar__bar">
<div class="van-submit-bar__price"><span>合计:</span> <span class="van-submit-bar__price-integer">¥0.</span> <span class="van-submit-bar__price-decimal">00</span></div>
<button disabled="disabled" class="van-button van-button--danger van-button--normal van-button--disabled van-button--unclickable">
<!----><span class="van-button__text">
</span></button>
</div>
</div>
`;

View File

@ -0,0 +1,26 @@
import SubmitBar from '../';
import demoTest from '../../../test/demo-test';
import { mount } from '@vue/test-utils';
demoTest(SubmitBar);
test('submit', () => {
const wrapper = mount(SubmitBar, {
propsData: {
price: 0.01,
disabled: true
}
});
expect(wrapper.html()).toMatchSnapshot();
// disabled
const button = wrapper.find('.van-button');
button.trigger('click');
expect(wrapper.emitted('submit')).toBeFalsy();
// submit
wrapper.vm.disabled = false;
button.trigger('click');
expect(wrapper.emitted('submit')).toBeTruthy();
});

View File

@ -128,10 +128,12 @@ export default create({
// initialize swipe position // initialize swipe position
initialize() { initialize() {
clearTimeout(this.timer); clearTimeout(this.timer);
const rect = this.$el.getBoundingClientRect(); if (this.$el) {
const rect = this.$el.getBoundingClientRect();
this.width = rect.width;
this.height = rect.height;
}
this.swiping = true; this.swiping = true;
this.width = rect.width;
this.height = rect.height;
this.active = this.initialSwipe; this.active = this.initialSwipe;
this.offset = this.count > 1 ? -this.size * this.active : 0; this.offset = this.count > 1 ? -this.size * this.active : 0;
this.swipes.forEach(swipe => { this.swipes.forEach(swipe => {

View File

@ -0,0 +1,58 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders swipe correctly 1`] = `
<div>
<div>
<div class="van-swipe">
<div class="van-swipe__track" style="width:0px;transition-duration:500ms;transform:translateX(0px);">
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">1</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">2</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">3</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">4</div>
</div>
<!---->
</div>
</div>
<div>
<div class="van-swipe">
<div class="van-swipe__track" style="width:0px;transition-duration:500ms;transform:translateX(0px);">
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">
<img>
</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">
<img>
</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">
<img>
</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">
<img>
</div>
</div>
<!---->
</div>
</div>
<div>
<div class="van-swipe">
<div class="van-swipe__track" style="width:0px;transition-duration:500ms;transform:translateX(0px);">
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">1</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">2</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">3</div>
<div class="van-swipe-item" style="width:0px;height:100%;transform:translateX(0px);">4</div>
</div>
<!---->
</div>
</div>
<div>
<div class="demo-swipe--vertical van-swipe">
<div class="van-swipe__track" style="height:0px;transition-duration:500ms;transform:translateY(0px);">
<div class="van-swipe-item" style="width:0px;height:0px;transform:translateY(0px);">1</div>
<div class="van-swipe-item" style="width:0px;height:0px;transform:translateY(0px);">2</div>
<div class="van-swipe-item" style="width:0px;height:0px;transform:translateY(0px);">3</div>
<div class="van-swipe-item" style="width:0px;height:0px;transform:translateY(0px);">4</div>
</div>
<!---->
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Swipe from '../';
import demoTest from '../../../test/demo-test';
demoTest(Swipe);

View File

@ -0,0 +1,60 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders switch-cell correctly 1`] = `
<div>
<div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-cell--center van-switch-cell">
<!---->
<div class="van-cell__title"><span>标题</span>
<!---->
</div>
<div class="van-cell__value">
<div title="标题" class="van-switch van-switch--on" style="font-size:30px;">
<div class="van-switch__node">
<!---->
</div>
</div>
</div>
<!---->
</div>
</div>
</div>
<div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-cell--center van-switch-cell">
<!---->
<div class="van-cell__title"><span>标题</span>
<!---->
</div>
<div class="van-cell__value">
<div title="标题" class="van-switch van-switch--on van-switch--disabled" style="font-size:30px;">
<div class="van-switch__node">
<!---->
</div>
</div>
</div>
<!---->
</div>
</div>
</div>
<div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell van-cell--center van-switch-cell">
<!---->
<div class="van-cell__title"><span>标题</span>
<!---->
</div>
<div class="van-cell__value">
<div title="标题" class="van-switch van-switch--on" style="font-size:30px;">
<div class="van-switch__node">
<div class="van-loading van-loading--circular van-loading--black van-switch__loading"><span class="van-loading__spinner van-loading__spinner--circular"> <svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div>
</div>
</div>
</div>
<!---->
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Sku from '../';
import demoTest from '../../../test/demo-test';
demoTest(Sku);

View File

@ -0,0 +1,34 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders switch correctly 1`] = `
<div>
<div>
<div class="van-switch van-switch--on" style="font-size:30px;">
<div class="van-switch__node">
<!---->
</div>
</div>
</div>
<div>
<div class="van-switch van-switch--on van-switch--disabled" style="font-size:30px;">
<div class="van-switch__node">
<!---->
</div>
</div>
</div>
<div>
<div class="van-switch van-switch--on" style="font-size:30px;">
<div class="van-switch__node">
<div class="van-loading van-loading--circular van-loading--black van-switch__loading"><span class="van-loading__spinner van-loading__spinner--circular"> <svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div>
</div>
</div>
</div>
<div>
<div class="van-switch van-switch--on" style="font-size:36px;">
<div class="van-switch__node">
<!---->
</div>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,4 @@
import Switch from '../';
import demoTest from '../../../test/demo-test';
demoTest(Switch);

Some files were not shown because too many files have changed in this diff Show More