Skip to content

Commit

Permalink
feat: 初始化多选组件
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhenfei committed Aug 22, 2020
1 parent 73804df commit cf59550
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
9 changes: 9 additions & 0 deletions components/pi-checkbox-group/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template />

<script>
export default {
name: 'PiCheckboxGroup'
}
</script>

<style scoped></style>
11 changes: 11 additions & 0 deletions components/pi-checkbox/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<template>
<view />
</template>

<script>
export default {
name: 'PiCheckbox'
}
</script>

<style scoped></style>
17 changes: 17 additions & 0 deletions utils/parent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* 根据组件名称获取父级组件
* @param componentScope 当前组件scope
* @param componentName 组件名称
* @returns {*|{$options}} 父级组件 | undefined
*/
export default function parent(componentScope, componentName) {
let parent = componentScope.$parent
while (parent && componentName) {
if (parent.$options && parent.$options.name !== componentName) {
parent = parent.$parent
} else {
return parent
}
}
return parent
}

0 comments on commit cf59550

Please sign in to comment.