zmp-vue
Version:
Build full featured iOS & Android apps using ZMP & Vue
52 lines (47 loc) • 1.91 kB
JavaScript
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, toDisplayString as _toDisplayString, mergeProps as _mergeProps, withCtx as _withCtx } from "vue";
var _hoisted_1 = {
key: 0,
class: "grid-item-icon"
};
var _hoisted_2 = {
key: 1,
class: "grid-item-label"
};
function render(_ctx, _cache) {
var _component_Icon = _resolveComponent("Icon");
var _component_Link = _resolveComponent("Link");
return _openBlock(), _createBlock(_component_Link, _mergeProps({
class: "grid-item no-ripple",
"no-link-class": "",
href: _ctx.to || '#'
}, _extends({}, _ctx.$props, _ctx.$attrs)), {
default: _withCtx(function () {
return [_ctx.icon || _ctx.$slots.icon ? (_openBlock(), _createBlock("span", _hoisted_1, [_ctx.$slots.icon ? _renderSlot(_ctx.$slots, "icon", {
key: 0
}) : (_openBlock(), _createBlock(_component_Icon, {
key: 1,
zmp: _ctx.icon
}, null, 8, ["zmp"]))])) : _createCommentVNode("", true), _renderSlot(_ctx.$slots, "default"), _ctx.label ? (_openBlock(), _createBlock("span", _hoisted_2, _toDisplayString(_ctx.label), 1)) : _createCommentVNode("", true)];
}),
_: 3
}, 16, ["href"]);
}
import Link from './link';
import Icon from './icon';
export default {
name: 'zmp-grid-item',
render: render,
components: {
Link: Link,
Icon: Icon
},
props: {
label: String,
icon: String,
to: String,
key: String,
disabled: Boolean
},
setup: function setup() {}
};