fix cell
This commit is contained in:
@@ -18,7 +18,39 @@ export default {
|
||||
|
||||
## Cell 单元格
|
||||
|
||||
### 基础用法
|
||||
### 使用指南
|
||||
|
||||
如果你已经按照[快速上手](/vue/component/quickstart)中引入了整个`ZanUI`,以下**组件注册**就可以忽略了,因为你已经全局注册了`ZanUI`中的全部组件。
|
||||
|
||||
#### 全局注册
|
||||
|
||||
你可以在全局注册`Cell`组件,比如页面的主文件(`index.js`,`main.js`),这样页面任何地方都可以直接使用`Cell`组件了:
|
||||
|
||||
```js
|
||||
import Vue from 'vue';
|
||||
import { Cell } from '@youzan/zanui-vue';
|
||||
import '@youzan/zanui-vue/lib/zanui-css/cell.css';
|
||||
|
||||
Vue.component(Cell.name, Cell);
|
||||
```
|
||||
|
||||
#### 局部注册
|
||||
|
||||
如果你只是想在某个组件中使用,你可以在对应组件中注册`Cell`组件,这样只能在你注册的组件中使用`Cell`:
|
||||
|
||||
```js
|
||||
import { Cell } from '@youzan/zanui-vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'zan-cell': Cell
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
### 代码演示
|
||||
|
||||
#### 基础用法
|
||||
|
||||
:::demo 基础用法
|
||||
```html
|
||||
@@ -29,7 +61,7 @@ export default {
|
||||
```
|
||||
:::
|
||||
|
||||
### 带*号,标明必填
|
||||
#### 带*号,标明必填
|
||||
|
||||
传入`required`属性
|
||||
|
||||
@@ -41,7 +73,7 @@ export default {
|
||||
```
|
||||
:::
|
||||
|
||||
### 标题带描述信息
|
||||
#### 标题带描述信息
|
||||
|
||||
传入`label`属性,属性值为描述信息的值。
|
||||
|
||||
@@ -54,7 +86,7 @@ export default {
|
||||
```
|
||||
:::
|
||||
|
||||
### 带图标
|
||||
#### 带图标
|
||||
|
||||
传入`icon`属性。
|
||||
|
||||
@@ -67,7 +99,7 @@ export default {
|
||||
```
|
||||
:::
|
||||
|
||||
### 可点击的链接
|
||||
#### 可点击的链接
|
||||
|
||||
传入`url`属性,传入`isLink`属性则会在右侧显示箭头。
|
||||
|
||||
@@ -80,7 +112,7 @@ export default {
|
||||
```
|
||||
:::
|
||||
|
||||
### 高级用法
|
||||
#### 高级用法
|
||||
|
||||
如以上用法不能满足你的需求,可以使用对应的`slot`来自定义显示的内容。包含三个`slot`,默认`slot`,`icon`和`title`的`slot`。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user