mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix: delete unused doc css
This commit is contained in:
parent
4555d82c8e
commit
31d1ae392b
@ -4,7 +4,7 @@ var render = require('json-templater/string');
|
|||||||
var uppercamelcase = require('uppercamelcase');
|
var uppercamelcase = require('uppercamelcase');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
|
||||||
var OUTPUT_PATH = path.join(__dirname, '../../src/index.js');
|
var OUTPUT_PATH = path.join(__dirname, '../../packages/index.js');
|
||||||
var IMPORT_TEMPLATE = 'import {{name}} from \'../packages/{{package}}/index.js\';';
|
var IMPORT_TEMPLATE = 'import {{name}} from \'../packages/{{package}}/index.js\';';
|
||||||
var ISNTALL_COMPONENT_TEMPLATE = ' {{name}}';
|
var ISNTALL_COMPONENT_TEMPLATE = ' {{name}}';
|
||||||
var MAIN_TEMPLATE = `{{include}}
|
var MAIN_TEMPLATE = `{{include}}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import vue from 'rollup-plugin-vue';
|
import vue from 'rollup-plugin-vue';
|
||||||
import alias from 'zan-rollup-plugin-alias';
|
import alias from 'zan-rollup-plugin-alias';
|
||||||
@ -8,6 +9,17 @@ import componentsConfig from '../components.json';
|
|||||||
|
|
||||||
const extensions = ['.js', '.vue'];
|
const extensions = ['.js', '.vue'];
|
||||||
|
|
||||||
|
// 打包时排除 mixins、utils、其他组件
|
||||||
|
const utilsPath = path.resolve(__dirname, '../packages/common/utils/');
|
||||||
|
const mixinsPath = path.resolve(__dirname, '../packages/common/mixins/');
|
||||||
|
const external = [
|
||||||
|
...fs.readdirSync(utilsPath).map(item => path.resolve(utilsPath, item)),
|
||||||
|
...fs.readdirSync(mixinsPath).map(item => path.resolve(mixinsPath, item)),
|
||||||
|
...Object.keys(componentsConfig).map(component =>
|
||||||
|
path.resolve(__dirname, '../packages', component, 'index.js')
|
||||||
|
)
|
||||||
|
];
|
||||||
|
|
||||||
export default Object.keys(componentsConfig).map(component => {
|
export default Object.keys(componentsConfig).map(component => {
|
||||||
return {
|
return {
|
||||||
entry: componentsConfig[component],
|
entry: componentsConfig[component],
|
||||||
@ -17,7 +29,12 @@ export default Object.keys(componentsConfig).map(component => {
|
|||||||
format: 'cjs'
|
format: 'cjs'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
external: ['vue', 'vue-lazyload'],
|
external: [
|
||||||
|
'vue',
|
||||||
|
'vue-lazyload',
|
||||||
|
path.resolve(__dirname, '../packages/common/mixins/popup/index.js'),
|
||||||
|
...external
|
||||||
|
],
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
babel({
|
babel({
|
||||||
@ -36,7 +53,7 @@ export default Object.keys(componentsConfig).map(component => {
|
|||||||
'src/mixins': path.resolve(__dirname, '../packages/common/mixins'),
|
'src/mixins': path.resolve(__dirname, '../packages/common/mixins'),
|
||||||
'src/utils': path.resolve(__dirname, '../packages/common/utils'),
|
'src/utils': path.resolve(__dirname, '../packages/common/utils'),
|
||||||
packages: path.resolve(__dirname, '../packages')
|
packages: path.resolve(__dirname, '../packages')
|
||||||
}),
|
})
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -3,7 +3,7 @@ const config = require('./webpack.config.dev.js');
|
|||||||
const isMinify = process.argv.indexOf('-p') !== -1;
|
const isMinify = process.argv.indexOf('-p') !== -1;
|
||||||
|
|
||||||
config.entry = {
|
config.entry = {
|
||||||
'vant': './src/index.js'
|
'vant': './packages/index.js'
|
||||||
};
|
};
|
||||||
|
|
||||||
config.output = {
|
config.output = {
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
const path = require('path');
|
|
||||||
const Components = require('../components.json');
|
|
||||||
const config = require('./webpack.build.js');
|
|
||||||
const webpack = require('webpack');
|
|
||||||
|
|
||||||
delete config.devtool;
|
|
||||||
|
|
||||||
const entry = {};
|
|
||||||
Object.keys(Components).forEach(key => {
|
|
||||||
entry[key + '/index'] = Components[key];
|
|
||||||
});
|
|
||||||
|
|
||||||
config.entry = entry;
|
|
||||||
|
|
||||||
config.externals = {
|
|
||||||
vue: {
|
|
||||||
root: 'Vue',
|
|
||||||
commonjs: 'vue',
|
|
||||||
commonjs2: 'vue',
|
|
||||||
amd: 'vue'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
config.output = {
|
|
||||||
path: path.join(__dirname, '../lib'),
|
|
||||||
filename: '[name].js',
|
|
||||||
libraryExport: "default",
|
|
||||||
libraryTarget: 'umd'
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = config;
|
|
@ -38,7 +38,8 @@ module.exports = {
|
|||||||
extensions: ['.js', '.vue', '.css'],
|
extensions: ['.js', '.vue', '.css'],
|
||||||
alias: {
|
alias: {
|
||||||
vue: 'vue/dist/vue.runtime.esm.js',
|
vue: 'vue/dist/vue.runtime.esm.js',
|
||||||
src: path.join(__dirname, '../src'),
|
'src/mixins': path.resolve(__dirname, '../packages/common/mixins'),
|
||||||
|
'src/utils': path.resolve(__dirname, '../packages/common/utils'),
|
||||||
packages: path.join(__dirname, '../packages'),
|
packages: path.join(__dirname, '../packages'),
|
||||||
lib: path.join(__dirname, '../lib'),
|
lib: path.join(__dirname, '../lib'),
|
||||||
components: path.join(__dirname, '../docs/src/components')
|
components: path.join(__dirname, '../docs/src/components')
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Dialog } from 'src/index';
|
import { Dialog } from 'packages/index';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ImagePreview } from 'src/index';
|
import { ImagePreview } from 'packages/index';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
@ -41,7 +41,7 @@ import { ImagePreview } from 'vant';
|
|||||||
<van-button @click="handleImagePreview">预览图片</van-button>
|
<van-button @click="handleImagePreview">预览图片</van-button>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ImagePreview } from 'src/index';
|
import { ImagePreview } from 'packages/index';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Toast } from 'src/index';
|
import { Toast } from 'packages/index';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
@ -85,7 +85,7 @@ import { Toast } from 'vant';
|
|||||||
<van-button @click="showCustomizedToast(5000)">倒数5秒</van-button>
|
<van-button @click="showCustomizedToast(5000)">倒数5秒</van-button>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Toast } from 'src/index';
|
import { Toast } from 'packages/index';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
@ -137,7 +137,7 @@ export default {
|
|||||||
<van-button @click="closeToast">关闭</van-button>
|
<van-button @click="closeToast">关闭</van-button>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Toast } from 'src/index';
|
import { Toast } from 'packages/index';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
@ -161,7 +161,7 @@ export default {
|
|||||||
<van-button @click="showHtmlToast">打开</van-button>
|
<van-button @click="showHtmlToast">打开</van-button>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Toast } from 'src/index';
|
import { Toast } from 'packages/index';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -54,37 +54,17 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
html, body, div, span, applet, object, iframe,
|
|
||||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
||||||
a, abbr, acronym, address, big, cite, code,
|
|
||||||
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
||||||
small, strike, strong, sub, sup, tt, var,
|
|
||||||
b, u, i, center,
|
|
||||||
dl, dt, dd, ol, ul, li,
|
|
||||||
fieldset, form, label, legend,
|
|
||||||
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
||||||
article, aside, canvas, details, embed,
|
|
||||||
figure, figcaption, footer, header, hgroup,
|
|
||||||
menu, nav, output, ruby, section, summary,
|
|
||||||
time, mark, audio, video {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border: 0;
|
|
||||||
font-size: 100%;
|
|
||||||
vertical-align: baseline;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: #4078c0;
|
color: #4078c0;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
body, html {
|
body {
|
||||||
height: 100%;
|
-webkit-font-smoothing: antialiased;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body, html {
|
||||||
font-family: 'Helvetica Neue',Helvetica,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',SimSun,sans-serif;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.examples-container {
|
.examples-container {
|
||||||
@ -95,38 +75,6 @@ export default {
|
|||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-back {
|
|
||||||
display: inline-block;
|
|
||||||
position: absolute;
|
|
||||||
top: 12px;
|
|
||||||
left: 10px;
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
text-align: center;
|
|
||||||
color: #333;
|
|
||||||
transform: rotate(180deg);
|
|
||||||
|
|
||||||
i {
|
|
||||||
font-size: 24px;
|
|
||||||
line-height: 40px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.demo-title {
|
|
||||||
font-size: 16px;
|
|
||||||
display: block;
|
|
||||||
line-height: 1;
|
|
||||||
padding: 20px 15px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.demo-sub-title {
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: normal;
|
|
||||||
color: #999;
|
|
||||||
padding: 0 15px;
|
|
||||||
margin: 30px 0 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -2,7 +2,7 @@ import Vue from 'vue';
|
|||||||
import VueRouter from 'vue-router';
|
import VueRouter from 'vue-router';
|
||||||
import App from './ExamplesApp';
|
import App from './ExamplesApp';
|
||||||
import routes from './router.config';
|
import routes from './router.config';
|
||||||
import ZanUI from 'src/index';
|
import ZanUI from 'packages/index';
|
||||||
import ZanDoc from 'zan-doc';
|
import ZanDoc from 'zan-doc';
|
||||||
import 'packages/vant-css/src/index.css';
|
import 'packages/vant-css/src/index.css';
|
||||||
|
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"lerna": "2.0.0-beta.31",
|
|
||||||
"version": "independent"
|
|
||||||
}
|
|
12
package.json
12
package.json
@ -14,8 +14,8 @@
|
|||||||
"bootstrap": "yarn || npm i && cd ./packages/vant-css/ && yarn || npm i && cd ../../",
|
"bootstrap": "yarn || npm i && cd ./packages/vant-css/ && yarn || npm i && cd ../../",
|
||||||
"dev": "npm run build:file && webpack-dev-server --inline --config build/webpack.config.dev.js --content-base ./",
|
"dev": "npm run build:file && webpack-dev-server --inline --config build/webpack.config.dev.js --content-base ./",
|
||||||
"build:file": "node build/bin/build-entry.js",
|
"build:file": "node build/bin/build-entry.js",
|
||||||
"build:utils": "cross-env BABEL_ENV=utils babel src --out-dir lib --ignore src/index.js --presets=es2015",
|
"build:utils": "cross-env BABEL_ENV=utils babel packages/common --out-dir lib/common --presets=es2015",
|
||||||
"build:components": "cross-env NODE_ENV=production webpack --progress --hide-modules --config build/webpack.components.js --color",
|
"build:components": "rollup -c ./build/rollup.component.config.js --color",
|
||||||
"build:vant-css": "gulp build --gulpfile packages/vant-css/gulpfile.js --color && cp -R packages/vant-css/lib/ lib/vant-css",
|
"build:vant-css": "gulp build --gulpfile packages/vant-css/gulpfile.js --color && cp -R packages/vant-css/lib/ lib/vant-css",
|
||||||
"build:vant": "cross-env NODE_ENV=production webpack --progress --hide-modules --color --config build/webpack.build.js && cross-env NODE_ENV=production webpack -p --progress --hide-modules --color --config build/webpack.build.js",
|
"build:vant": "cross-env NODE_ENV=production webpack --progress --hide-modules --color --config build/webpack.build.js && cross-env NODE_ENV=production webpack -p --progress --hide-modules --color --config build/webpack.build.js",
|
||||||
"deploy": "npm run deploy:docs && npm run deploy:cdn && gh-pages -d docs/dist --remote youzan && rimraf docs/dist",
|
"deploy": "npm run deploy:docs && npm run deploy:cdn && gh-pages -d docs/dist --remote youzan && rimraf docs/dist",
|
||||||
@ -27,8 +27,7 @@
|
|||||||
"test": "karma start test/unit/karma.conf.js --single-run",
|
"test": "karma start test/unit/karma.conf.js --single-run",
|
||||||
"test:coverage": "open test/unit/coverage/lcov-report/index.html",
|
"test:coverage": "open test/unit/coverage/lcov-report/index.html",
|
||||||
"test:watch": "karma start test/unit/karma.conf.js",
|
"test:watch": "karma start test/unit/karma.conf.js",
|
||||||
"release": "npm run bootstrap && sh build/release.sh",
|
"release": "npm run bootstrap && sh build/release.sh"
|
||||||
"rollup": "rollup -c ./build/rollup.component.config.js"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -89,7 +88,6 @@
|
|||||||
"karma-sourcemap-loader": "^0.3.7",
|
"karma-sourcemap-loader": "^0.3.7",
|
||||||
"karma-spec-reporter": "^0.0.31",
|
"karma-spec-reporter": "^0.0.31",
|
||||||
"karma-webpack": "^2.0.4",
|
"karma-webpack": "^2.0.4",
|
||||||
"lerna": "^2.0.0",
|
|
||||||
"markdown-it": "^8.3.2",
|
"markdown-it": "^8.3.2",
|
||||||
"markdown-it-container": "^2.0.0",
|
"markdown-it-container": "^2.0.0",
|
||||||
"mocha": "^3.4.2",
|
"mocha": "^3.4.2",
|
||||||
@ -100,7 +98,7 @@
|
|||||||
"precss": "^2.0.0",
|
"precss": "^2.0.0",
|
||||||
"progress-bar-webpack-plugin": "^1.10.0",
|
"progress-bar-webpack-plugin": "^1.10.0",
|
||||||
"rimraf": "^2.5.4",
|
"rimraf": "^2.5.4",
|
||||||
"rollup": "^0.45.2",
|
"rollup": "^0.47.4",
|
||||||
"rollup-plugin-babel": "^3.0.1",
|
"rollup-plugin-babel": "^3.0.1",
|
||||||
"rollup-plugin-commonjs": "^8.1.0",
|
"rollup-plugin-commonjs": "^8.1.0",
|
||||||
"rollup-plugin-node-resolve": "^3.0.0",
|
"rollup-plugin-node-resolve": "^3.0.0",
|
||||||
@ -120,7 +118,7 @@
|
|||||||
"vue-style-loader": "^3.0.0",
|
"vue-style-loader": "^3.0.0",
|
||||||
"vue-template-compiler": "^2.4.2",
|
"vue-template-compiler": "^2.4.2",
|
||||||
"vue-template-es2015-compiler": "^1.5.3",
|
"vue-template-es2015-compiler": "^1.5.3",
|
||||||
"webpack": "^3.5.1",
|
"webpack": "^3.5.4",
|
||||||
"webpack-dev-server": "^2.7.1",
|
"webpack-dev-server": "^2.7.1",
|
||||||
"webpack-merge": "^4.1.0",
|
"webpack-merge": "^4.1.0",
|
||||||
"zan-doc": "0.1.12",
|
"zan-doc": "0.1.12",
|
||||||
|
@ -51,12 +51,10 @@
|
|||||||
this.wrap = this.$refs.cell.querySelector('.van-cell-wrapper');
|
this.wrap = this.$refs.cell.querySelector('.van-cell-wrapper');
|
||||||
this.leftElm = this.$refs.left;
|
this.leftElm = this.$refs.left;
|
||||||
this.leftWrapElm = this.leftElm.parentNode;
|
this.leftWrapElm = this.leftElm.parentNode;
|
||||||
this.leftDefaultTransform = this.translate3d(-this.leftWidth - 1);
|
|
||||||
this.leftWrapElm.style.webkitTransform = this.leftDefaultTransform;
|
this.leftWrapElm.style.webkitTransform = this.leftDefaultTransform;
|
||||||
|
|
||||||
this.rightElm = this.$refs.right;
|
this.rightElm = this.$refs.right;
|
||||||
this.rightWrapElm = this.rightElm.parentNode;
|
this.rightWrapElm = this.rightElm.parentNode;
|
||||||
this.rightDefaultTransform = this.translate3d(this.rightWidth);
|
|
||||||
this.rightWrapElm.style.webkitTransform = this.rightDefaultTransform;
|
this.rightWrapElm.style.webkitTransform = this.rightDefaultTransform;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -100,14 +98,12 @@
|
|||||||
}, 0);
|
}, 0);
|
||||||
},
|
},
|
||||||
startDrag(evt) {
|
startDrag(evt) {
|
||||||
console.log('startDrag')
|
|
||||||
evt = evt.changedTouches ? evt.changedTouches[0] : evt;
|
evt = evt.changedTouches ? evt.changedTouches[0] : evt;
|
||||||
this.dragging = true;
|
this.dragging = true;
|
||||||
this.start.x = evt.pageX;
|
this.start.x = evt.pageX;
|
||||||
this.start.y = evt.pageY;
|
this.start.y = evt.pageY;
|
||||||
},
|
},
|
||||||
onDrag(evt) {
|
onDrag(evt) {
|
||||||
console.log('onDrag')
|
|
||||||
if (this.opened) {
|
if (this.opened) {
|
||||||
!this.swiping && this.swipeMove(0);
|
!this.swiping && this.swipeMove(0);
|
||||||
this.opened = false;
|
this.opened = false;
|
||||||
@ -132,7 +128,6 @@
|
|||||||
this.swipeMove(offsetLeft);
|
this.swipeMove(offsetLeft);
|
||||||
},
|
},
|
||||||
endDrag() {
|
endDrag() {
|
||||||
console.log('endDrag')
|
|
||||||
if (!this.swiping) return;
|
if (!this.swiping) return;
|
||||||
this.swipeLeaveTransition(this.offsetLeft > 0 ? -1 : 1);
|
this.swipeLeaveTransition(this.offsetLeft > 0 ? -1 : 1);
|
||||||
}
|
}
|
||||||
|
@ -24,11 +24,9 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
triggerWaterfallLower() {
|
triggerWaterfallLower() {
|
||||||
console.log('waterfall lower trigger');
|
|
||||||
this.onWaterfallLower();
|
this.onWaterfallLower();
|
||||||
},
|
},
|
||||||
triggerWaterfallUpper() {
|
triggerWaterfallUpper() {
|
||||||
console.log('waterfall upper trigger');
|
|
||||||
this.onWaterfallUpper();
|
this.onWaterfallUpper();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user