Skip to content

Commit

Permalink
removeAll method
Browse files Browse the repository at this point in the history
  • Loading branch information
a.nikitin committed Oct 26, 2023
1 parent cc9a1de commit 5321b35
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "vue-selectpage",
"description": "SelectPage for Vue, a select items components provides the list of items with pagination",
"version": "3.0.7",
"version": "3.0.8",
"author": "TerryZ <terry5@foxmail.com>",
"type": "module",
"files": [
Expand Down
7 changes: 4 additions & 3 deletions src/SelectPageList.js
Expand Up @@ -16,15 +16,17 @@ export default defineComponent({
...dropdownProps()
},
emits: ['visible-change'],
setup (props, { emit, attrs }) {
setup (props, { emit, expose, attrs }) {
const {
visible,
adjustDropdown,
closeDropdown,
renderDropdown
} = useDropdown(props)

const {removeAll} = useRender(props, emit)
const removeAll = () => {
selectedItems.value = [];
}

expose({
removeAll,
Expand All @@ -33,7 +35,6 @@ export default defineComponent({
const selectedItems = ref([])
const core = ref(null)


return () => {
console.log('attrs', attrs);
const elementOption = {
Expand Down
10 changes: 9 additions & 1 deletion src/SelectPageTable.js
Expand Up @@ -16,14 +16,22 @@ export default defineComponent({
...dropdownProps()
},
emits: ['visible-change'],
setup (props, { emit, attrs }) {
setup (props, { emit, expose, attrs }) {
const {
visible,
adjustDropdown,
closeDropdown,
renderDropdown
} = useDropdown(props)

const removeAll = () => {
selectedItems.value = [];
}

expose({
removeAll,
})

const selectedItems = ref([])
const core = ref(null)

Expand Down
1 change: 0 additions & 1 deletion src/core/render.js
Expand Up @@ -197,7 +197,6 @@ export function useDropdown (props) {
ref: dropdownRef,
border: false,
fullWidth: true,
width: '100%',
disabled: props.disabled,
customTriggerClass: props?.customTriggerClass,
customContainerClass: props?.customContainerClass,
Expand Down

0 comments on commit 5321b35

Please sign in to comment.