framework7-vue
Version:
Build full featured iOS & Android apps using Framework7 & Vue
45 lines • 1.52 kB
JavaScript
import { toDisplayString as _toDisplayString, renderSlot as _renderSlot, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
const _hoisted_1 = ["href", "data-confirm", "data-confirm-title"];
function render(_ctx, _cache) {
return _openBlock(), _createElementBlock("a", {
href: _ctx.href || '#',
"data-confirm": _ctx.confirmText || undefined,
"data-confirm-title": _ctx.confirmTitle || undefined,
class: _normalizeClass(_ctx.classes),
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
}, [_createTextVNode(_toDisplayString(_ctx.text) + " ", 1), _renderSlot(_ctx.$slots, "default")], 10, _hoisted_1);
}
import { computed } from 'vue';
import { classNames } from '../shared/utils.js';
import { colorClasses, colorProps } from '../shared/mixins.js';
export default {
name: 'f7-swipeout-button',
render,
props: {
text: String,
confirmTitle: String,
confirmText: String,
overswipe: Boolean,
close: Boolean,
delete: Boolean,
href: String,
...colorProps
},
emits: ['click'],
setup(props, {
emit
}) {
const onClick = e => {
emit('click', e);
};
const classes = computed(() => classNames({
'swipeout-overswipe': props.overswipe,
'swipeout-delete': props.delete,
'swipeout-close': props.close
}, colorClasses(props)));
return {
classes,
onClick
};
}
};