Skip to content

Commit

Permalink
修复通过ref调用组件时未暴露方法问题
Browse files Browse the repository at this point in the history
  • Loading branch information
think-gem committed Oct 25, 2024
1 parent e890556 commit 776067b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/ListSelect/src/ListSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
</div>
</template>
<script lang="ts" setup name="JeeSiteListSelect">
import { defineComponent, ref, unref, computed, watch, onMounted, shallowRef } from 'vue';
import { ref, unref, computed, watch, onMounted, shallowRef } from 'vue';
import { Input } from 'ant-design-vue';
import { propTypes } from '/@/utils/propTypes';
import { useAttrs } from '/@/hooks/core/useAttrs';
import { useI18n } from '/@/hooks/web/useI18n';

import { useModal } from '/@/components/Modal';
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
Expand Down Expand Up @@ -58,7 +57,6 @@

const emit = defineEmits(['change', 'select', 'click']);

const { t } = useI18n();
const attrs = useAttrs();
const valueRef = ref<string>(props.value);
const labelValueRef = ref<string>(props.labelValue);
Expand Down Expand Up @@ -195,6 +193,11 @@
emit('change', valueRef.value, labelValueRef.value);
emit('select', values);
}

defineExpose({
openSelectModal,
setSelectList,
});
</script>
<style lang="less">
.jeesite-listselect {
Expand Down

0 comments on commit 776067b

Please sign in to comment.