diff --git a/build/webpack.config.dev.js b/build/webpack.config.dev.js index d2538370d..04ca6c82f 100644 --- a/build/webpack.config.dev.js +++ b/build/webpack.config.dev.js @@ -7,6 +7,7 @@ var getPostcssPlugin = require('./utils/postcss_pipe'); var ProgressBarPlugin = require('progress-bar-webpack-plugin'); var HtmlWebpackPlugin = require('html-webpack-plugin'); var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); +var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') var StyleExtractPlugin; if (process.env.NODE_ENV === 'production') { @@ -25,8 +26,7 @@ function convert(str) { function wrap(render) { return function() { return render.apply(this, arguments) - .replace('', ''); + .replace(/\

Cell Swipe 滑动单元格

+ + + + + + + 删除 + + + 选择 + + + +
+ + \ No newline at end of file diff --git a/docs/examples-dist/checkbox.vue b/docs/examples-dist/checkbox.vue index 9a9b13486..89c897ed2 100644 --- a/docs/examples-dist/checkbox.vue +++ b/docs/examples-dist/checkbox.vue @@ -7,7 +7,7 @@
- 复选框2 + 复选框2
@@ -15,7 +15,7 @@
- 复选框{{item}} + 复选框{{item}}
@@ -24,7 +24,7 @@
- 复选框{{item}} + 复选框{{item}}
@@ -33,7 +33,7 @@
- + 复选框{{item}} diff --git a/docs/examples-dist/icon.vue b/docs/examples-dist/icon.vue index dc0e0a8e7..40620f0e0 100644 --- a/docs/examples-dist/icon.vue +++ b/docs/examples-dist/icon.vue @@ -1,4 +1,7 @@ +## CellSwipe 滑动单元格 + +### 使用指南 + +如果你已经按照快速上手中引入了整个`vant`,以下**组件注册**就可以忽略了,因为你已经全局注册了`vant`中的全部组件。 + +#### 全局注册 + +你可以在全局注册`Cell Swipe`组件,比如页面的主文件(`index.js`,`main.js`),这样页面任何地方都可以直接使用`Cell Swipe`组件了: + +```js +import Vue from 'vue'; +import { CellSwipe } from 'vant'; +import 'vant/lib/vant-css/cell-swipe.css'; + +Vue.component(CellSwipe.name, CellSwipe); +``` + +#### 局部注册 + +如果你只是想在某个组件中使用,你可以在对应组件中注册`Cell Swipe`组件,这样只能在你注册的组件中使用`Cell Swipe`: + +```js +import { CellSwipe } from 'vant'; + +export default { + components: { + 'van-cell-swipe': CellSwipe + } +}; +``` + +### 代码演示 + +#### 基础用法 + +:::demo 基础用法 +```html + + + + + + + 删除 + + + 选择 + + +``` +::: + + +### API + +| 参数 | 说明 | 类型 | 默认值 | 可选值 | +|-----------|-----------|-----------|-------------|-------------| +| right-width | 右侧滑动按钮宽度 | `number` | 0 | | +| left-width | 左侧滑动按钮宽度 | `number` | 0 | | + +### Slot + +| name | 描述 | +|-----------|-----------| +| - | 自定义显示内容 | +| right | 右侧滑动内容 | +| left | 左侧滑动内容 | diff --git a/docs/examples-docs/checkbox.md b/docs/examples-docs/checkbox.md index 1a0bdf894..dffb5c5a9 100644 --- a/docs/examples-docs/checkbox.md +++ b/docs/examples-docs/checkbox.md @@ -101,7 +101,7 @@ export default { :::demo 禁用状态 ```html
- 复选框2 + 复选框2
``` ::: diff --git a/docs/examples-docs/waterfall.md b/docs/examples-docs/waterfall.md index cc33311d6..6883952d2 100644 --- a/docs/examples-docs/waterfall.md +++ b/docs/examples-docs/waterfall.md @@ -105,7 +105,8 @@ export default { >
{{ item }} diff --git a/docs/src/components/demo-list.vue b/docs/src/components/demo-list.vue index 5beb190a2..301202bb9 100644 --- a/docs/src/components/demo-list.vue +++ b/docs/src/components/demo-list.vue @@ -3,9 +3,9 @@

Zan UI Wap

有赞移动wap端组件库

-