feat: add usePublicApi

This commit is contained in:
chenjiahan
2020-08-31 16:57:49 +08:00
parent e1ac3f9a58
commit 0d64cf1b63
5 changed files with 32 additions and 39 deletions
+3 -13
View File
@@ -1,13 +1,6 @@
import {
ref,
watch,
computed,
reactive,
nextTick,
onMounted,
getCurrentInstance,
} from 'vue';
import { ref, watch, computed, reactive, nextTick, onMounted } from 'vue';
import { createNamespace, pick } from '../utils';
import { usePublicApi } from '../composition/use-public-api';
import { pickerProps } from '../picker/shared';
import Picker from '../picker';
@@ -281,10 +274,7 @@ export default createComponent({
}
);
// @exposed-api
const vm = getCurrentInstance().proxy;
vm.reset = reset;
vm.getArea = getArea;
usePublicApi({ reset, getArea });
return () => {
const columns = state.columns.slice(0, +props.columnsNum);