framework7-vue
Version:
Build full featured iOS & Android apps using Framework7 & Vue
53 lines • 1.79 kB
JavaScript
import { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveDynamicComponent as _resolveDynamicComponent, normalizeClass as _normalizeClass, withCtx as _withCtx, createBlock as _createBlock } from "vue";
const _hoisted_1 = {
key: 0,
class: "segmented-highlight"
};
function render(_ctx, _cache) {
return _openBlock(), _createBlock(_resolveDynamicComponent(_ctx.tag), {
class: _normalizeClass(_ctx.classes)
}, {
default: _withCtx(() => [_renderSlot(_ctx.$slots, "default"), _ctx.strong || _ctx.strongIos || _ctx.strongMd ? (_openBlock(), _createElementBlock("span", _hoisted_1)) : _createCommentVNode("", true)]),
_: 3
}, 8, ["class"]);
}
import { computed } from 'vue';
import { classNames } from '../shared/utils.js';
import { colorClasses, colorProps } from '../shared/mixins.js';
export default {
name: 'f7-segmented',
render,
props: {
raised: Boolean,
raisedIos: Boolean,
raisedMd: Boolean,
round: Boolean,
roundIos: Boolean,
roundMd: Boolean,
strong: Boolean,
strongIos: Boolean,
strongMd: Boolean,
tag: {
type: String,
default: 'div'
},
...colorProps
},
setup(props) {
const classes = computed(() => classNames({
segmented: true,
'segmented-raised': props.raised,
'segmented-raised-ios': props.raisedIos,
'segmented-raised-md': props.raisedMd,
'segmented-round': props.round,
'segmented-round-ios': props.roundIos,
'segmented-round-md': props.roundMd,
'segmented-strong': props.strong,
'segmented-strong-ios': props.strongIos,
'segmented-strong-md': props.strongMd
}, colorClasses(props)));
return {
classes
};
}
};