搜索结果列表页面开发
This commit is contained in:
31
src/components/GLink/README.md
Normal file
31
src/components/GLink/README.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# GLink组件
|
||||
|
||||
### 说明
|
||||
1. GLink组件组合了router-link和a标签,通过传入to或者href参数,自适应生成链接
|
||||
2. GLink组件已全局声明(使用期无需再次引用)
|
||||
|
||||
``` js
|
||||
<GLink :to="{ name: 'repo', params: { namespace: 'demo' }, query: { id: 111 } }">点击跳转</GLink>
|
||||
<GLink href="https://gitcode.net" target="_blank">点击跳转</GLink>
|
||||
<GLink @click.stop="handleClick">点击触发事件</GLink>
|
||||
```
|
||||
|
||||
### Props
|
||||
|
||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
||||
|-----------|------------------------|----------------------------|----------|-----------|
|
||||
| to? | 同router-link标签的to参数 | object | - | - |
|
||||
| href? | 同a标签的href参数 | string | - | - |
|
||||
| target? | 同a标签的target参数,router-link也支持 | string | - | - |
|
||||
| disabled? | 禁用 | boolean | - | false |
|
||||
|
||||
### Slots
|
||||
|
||||
| 名称 | 说明 |
|
||||
|---------------------|---------------------------------------------|
|
||||
| default | 链接点击的 |
|
||||
|
||||
## 注意事项
|
||||
1. 同时传入to相比href,优先级更高
|
||||
2. href参数默认值为“javascript:void(0)”
|
||||
|
||||
Reference in New Issue
Block a user