vivo-ui
Version:
vivo ui component lib for vue
38 lines (35 loc) • 1.53 kB
JavaScript
(function () {
if (typeof document !== 'undefined') {
var head = document.head || document.getElementsByTagName('head')[0],
style = document.createElement('style'),
css = " .vui-swipeout-button { width: 80px; height: 100%; color: #fff; font-size: 14px; text-align: center; } .vui-swipeout-button-default { background-color: #336DD6; } .vui-swipeout-button-delete{ background-color: #D23934; } .vui-swipeout-button-success{ background-color: #1AAD19; } .vui-swipeout-button-info{ background-color: #46b8da; } .vui-swipeout-button-warning{ background-color: #f0ad4e; } .vui-swipeout-button-gray{ background-color: #c8c7cd; } ";style.type = 'text/css';if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}head.appendChild(style);
}
})();
var swipeoutButton = { render: function render() {
var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: [this.$parent.prefixCls + '-button', this.$parent.prefixCls + '-button-' + this.type], on: { "click": _vm.onClick } }, [_vm._t("default")], 2);
}, staticRenderFns: [],
name: 'swipeoutButton',
props: {
autoClose: {
type: Boolean,
default: true
},
type: {
type: String,
default: 'default'
}
},
methods: {
onClick: function onClick() {
if (this.autoClose) {
this.$parent.onButtonClick();
}
this.$emit('on-click');
}
}
};
export default swipeoutButton;