mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
cell component add click event
This commit is contained in:
parent
f55d3cb7c4
commit
975c39029b
@ -6,6 +6,16 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
methods: {
|
||||||
|
handleClick() {
|
||||||
|
console.log('cell click');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
## Cell 组件
|
## Cell 组件
|
||||||
|
|
||||||
### 基础用法
|
### 基础用法
|
||||||
@ -24,7 +34,7 @@
|
|||||||
:::demo 传入`label`属性,属性值为描述信息的值。
|
:::demo 传入`label`属性,属性值为描述信息的值。
|
||||||
```html
|
```html
|
||||||
<o2-cell-group>
|
<o2-cell-group>
|
||||||
<o2-cell title="单元格1" label="描述信息" is-link></o2-cell>
|
<o2-cell title="单元格1" label="描述信息" is-link url="javascript:void(0)" @click="handleClick"></o2-cell>
|
||||||
<o2-cell title="单元格2" label="描述信息"></o2-cell>
|
<o2-cell title="单元格2" label="描述信息"></o2-cell>
|
||||||
</o2-cell-group>
|
</o2-cell-group>
|
||||||
```
|
```
|
||||||
|
@ -1 +1,15 @@
|
|||||||
## Field组件
|
## Field组件
|
||||||
|
|
||||||
|
表单中`input`或`textarea`的输入框。
|
||||||
|
|
||||||
|
### API
|
||||||
|
|
||||||
|
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
||||||
|
|-----------|-----------|-----------|-------------|-------------|
|
||||||
|
| type | 输入框类型 | string | text | text, number, email, url, tel, date, datetime, password, textarea |
|
||||||
|
| placeholder | 输入框placeholder | string | '' | |
|
||||||
|
| value | 输入框的值 | string | '' | |
|
||||||
|
| label | 输入框标签 | string | '' | |
|
||||||
|
| disabled | 是否禁用输入框 | boolean | false | |
|
||||||
|
| readonly | 输入框是否只读 | boolean | false | |
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<a class="o2-cell" :href="url">
|
<a class="o2-cell" :href="url" @click="handleClick">
|
||||||
<div class="o2-cell-title">
|
<div class="o2-cell-title">
|
||||||
<slot name="icon">
|
<slot name="icon">
|
||||||
<i v-if="icon" class="zui-icon" :class="'zui-icon-' + icon"></i>
|
<i v-if="icon" class="zui-icon" :class="'zui-icon-' + icon"></i>
|
||||||
@ -29,6 +29,12 @@ export default {
|
|||||||
url: String,
|
url: String,
|
||||||
label: String,
|
label: String,
|
||||||
isLink: Boolean
|
isLink: Boolean
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
handleClick() {
|
||||||
|
this.$emit('click');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -5,7 +5,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import O2Cell from 'packages/cell';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'o2-filed'
|
name: 'o2-filed',
|
||||||
|
|
||||||
|
components: {
|
||||||
|
O2Cell
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
0
packages/zanui/src/field.pcss
Normal file
0
packages/zanui/src/field.pcss
Normal file
Loading…
x
Reference in New Issue
Block a user