UNPKG

@tarojs/components

Version:
23 lines 745 B
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray"; import { h } from 'vue'; import { useForwardRef } from './forwardRef'; export default function createComponent(name) { var classNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; return { emits: ['tap'], setup: function setup(props, _ref) { var slots = _ref.slots, emit = _ref.emit; var forwardRef = useForwardRef(); return function () { return h("".concat(name, "-core"), { ref: forwardRef, class: ['hydrated'].concat(_toConsumableArray(classNames)), onClick: function onClick(e) { emit('tap', e); } }, slots); }; } }; }