UNPKG

@mydoge/y-ui

Version:

65 lines (54 loc) 1.65 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var utils = require('@mydoge/y-ui/lib/utils'); var runtimeDom = require('@vue/runtime-dom'); function initDev() { { runtimeDom.initCustomFormatter(); } } // This entry exports the runtime only, and is built as if ((process.env.NODE_ENV !== 'production')) { initDev(); } const ButtonType = ['primary', 'success', 'info', 'warning', 'danger', 'text']; const ButtonSize = ['large', 'medium', 'small', 'mini']; const buttonProps = { type: { type: String, validator(value) { return ButtonType.includes(value); } }, size: { type: String, validator(value) { return ButtonSize.includes(value); } } }; var script = runtimeDom.defineComponent({ name: 'YButton', props: buttonProps, emits: ['click'], setup(props, { emit }) { const text = 'Hello YButton'; const handleClick = () => { emit('click', buttonProps); }; return { text, handleClick }; } }); function render(_ctx, _cache, $props, $setup, $data, $options) { return (runtimeDom.openBlock(), runtimeDom.createElementBlock("button", { onClick: _cache[0] || (_cache[0] = (...args) => (_ctx.handleClick && _ctx.handleClick(...args))) }, runtimeDom.toDisplayString(_ctx.text), 1 /* TEXT */)) } script.render = render; script.__file = "packages/components/Button/src/button.vue"; const YButton = utils.withInstall(script); exports.YButton = YButton; exports.default = YButton;