import PropTypes from '../../../_util/vue-types'; import BasePopup from '../Base/BasePopup'; import SearchInput from '../SearchInput'; import { createRef } from '../util'; const SinglePopup = { name: 'SinglePopup', inheritAttrs: false, props: { ...BasePopup.props, ...SearchInput.props, searchValue: PropTypes.string, showSearch: PropTypes.looseBool, dropdownPrefixCls: PropTypes.string, disabled: PropTypes.looseBool, searchPlaceholder: PropTypes.string, }, created() { this.inputRef = createRef(); this.searchRef = createRef(); this.popupRef = createRef(); }, methods: { onPlaceholderClick() { this.inputRef.current.focus(); }, getTree() { return this.popupRef.current && this.popupRef.current.getTree(); }, _renderPlaceholder() { const { searchPlaceholder, searchValue, prefixCls } = this.$props; if (!searchPlaceholder) { return null; } return ( {searchPlaceholder} ); }, _renderSearch() { const { showSearch, dropdownPrefixCls } = this.$props; if (!showSearch) { return null; } return ( ); }, }, render() { return ( ); }, }; export default SinglePopup;