From 853417d470e8c12c5d4b0b54c76d8dc33eb2a7fb Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Thu, 20 Aug 2020 22:32:34 +0800 Subject: [PATCH] chore: remove Panel component --- src/panel/README.md | 55 --------------- src/panel/README.zh-CN.md | 59 ---------------- src/panel/demo/index.vue | 41 ----------- src/panel/index.less | 13 ---- src/panel/index.tsx | 69 ------------------- .../test/__snapshots__/demo.spec.js.snap | 39 ----------- src/panel/test/demo.spec.js | 4 -- vant.config.js | 8 --- 8 files changed, 288 deletions(-) delete mode 100644 src/panel/README.md delete mode 100644 src/panel/README.zh-CN.md delete mode 100644 src/panel/demo/index.vue delete mode 100644 src/panel/index.less delete mode 100644 src/panel/index.tsx delete mode 100644 src/panel/test/__snapshots__/demo.spec.js.snap delete mode 100644 src/panel/test/demo.spec.js diff --git a/src/panel/README.md b/src/panel/README.md deleted file mode 100644 index 72cf7fad7..000000000 --- a/src/panel/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# Panel - -### Deprecate Tip - -The Panel component will be deprecated in version 3.0. Please use the Cell and Button components instead. - -### Install - -```js -import Vue from 'vue'; -import { Panel } from 'vant'; - -Vue.use(Panel); -``` - -## Usage - -### Basic Usage - -```html - -
Content
-
-``` - -### Advanced Usage - -```html - -
Content
- -
-``` - -## API - -### Props - -| Attribute | Description | Type | Default | -| --------- | ----------- | -------- | ------- | -| icon | Left Icon | _string_ | - | -| title | Title | _string_ | - | -| desc | Description | _string_ | - | -| status | Status | _string_ | - | - -### Slots - -| Name | Description | -| ------- | ------------- | -| default | Default slot | -| header | Custom header | -| footer | Custom footer | diff --git a/src/panel/README.zh-CN.md b/src/panel/README.zh-CN.md deleted file mode 100644 index 77d6d9ba8..000000000 --- a/src/panel/README.zh-CN.md +++ /dev/null @@ -1,59 +0,0 @@ -# Panel 面板 - -### 废弃提示 - -由于使用场景有限,Panel 组件将在 3.0 版本中废弃,请直接使用 Cell 和 Button 组件代替 - -### 引入 - -```js -import Vue from 'vue'; -import { Panel } from 'vant'; - -Vue.use(Panel); -``` - -## 代码演示 - -### 基础用法 - -面板只是一个容器,里面可以放入自定义的内容 - -```html - -
内容
-
-``` - -### 高级用法 - -使用`slot`自定义内容 - -```html - -
内容
- -
-``` - -## API - -### Props - -| 参数 | 说明 | 类型 | 默认值 | -| ------ | ------------------------------------------ | -------- | ------ | -| title | 标题 | _string_ | - | -| desc | 描述 | _string_ | - | -| status | 状态 | _string_ | - | -| icon | 标题左侧[图标名称](#/zh-CN/icon)或图片链接 | _string_ | - | - -### Slots - -| 名称 | 说明 | -| ------- | ------------- | -| default | 自定义内容 | -| header | 自定义 header | -| footer | 自定义 footer | diff --git a/src/panel/demo/index.vue b/src/panel/demo/index.vue deleted file mode 100644 index afbb25f35..000000000 --- a/src/panel/demo/index.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - - - diff --git a/src/panel/index.less b/src/panel/index.less deleted file mode 100644 index 13e17f638..000000000 --- a/src/panel/index.less +++ /dev/null @@ -1,13 +0,0 @@ -@import '../style/var'; - -.van-panel { - background: @panel-background-color; - - &__header-value { - color: @panel-header-value-color; - } - - &__footer { - padding: @panel-footer-padding; - } -} diff --git a/src/panel/index.tsx b/src/panel/index.tsx deleted file mode 100644 index b6b173437..000000000 --- a/src/panel/index.tsx +++ /dev/null @@ -1,69 +0,0 @@ -// Utils -import { createNamespace } from '../utils'; -import { inherit } from '../utils/functional'; -import { BORDER_TOP } from '../utils/constant'; - -// Components -import Cell from '../cell'; -import CellGroup from '../cell-group'; - -// Types -import { CreateElement, RenderContext } from 'vue/types'; -import { ScopedSlot, DefaultSlots } from '../utils/types'; - -export type PanelProps = { - icon?: string; - desc?: string; - title?: string; - status?: string; -}; - -export type PanelSlots = DefaultSlots & { - header?: ScopedSlot; - footer?: ScopedSlot; -}; - -const [createComponent, bem] = createNamespace('panel'); - -function Panel( - h: CreateElement, - props: PanelProps, - slots: PanelSlots, - ctx: RenderContext -) { - const Content = () => [ - slots.header ? ( - slots.header() - ) : ( - - ), -
{slots.default && slots.default()}
, - slots.footer && ( -
{slots.footer()}
- ), - ]; - - return ( - - ); -} - -Panel.props = { - icon: String, - desc: String, - title: String, - status: String, -}; - -export default createComponent(Panel); diff --git a/src/panel/test/__snapshots__/demo.spec.js.snap b/src/panel/test/__snapshots__/demo.spec.js.snap deleted file mode 100644 index 97129d470..000000000 --- a/src/panel/test/__snapshots__/demo.spec.js.snap +++ /dev/null @@ -1,39 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renders demo correctly 1`] = ` -
-
-
-
-
标题 -
描述信息
-
-
状态
-
-
-
内容
-
-
-
-
-
-
-
标题 -
描述信息
-
-
状态
-
-
-
内容
-
- -
-
-
-`; diff --git a/src/panel/test/demo.spec.js b/src/panel/test/demo.spec.js deleted file mode 100644 index 5c70922b5..000000000 --- a/src/panel/test/demo.spec.js +++ /dev/null @@ -1,4 +0,0 @@ -import Demo from '../demo'; -import { snapshotDemo } from '../../../test/demo'; - -snapshotDemo(Demo); diff --git a/vant.config.js b/vant.config.js index 68ae3d46c..8b99d25b9 100644 --- a/vant.config.js +++ b/vant.config.js @@ -355,10 +355,6 @@ module.exports = { path: 'submit-bar', title: 'SubmitBar 提交订单栏', }, - // { - // path: 'sku', - // title: 'Sku 商品规格', - // }, ], }, ], @@ -689,10 +685,6 @@ module.exports = { path: 'submit-bar', title: 'SubmitBar', }, - // { - // path: 'sku', - // title: 'Sku', - // }, ], }, ],