@ccos/webos-vue
Version:
A Web-Ui Framework for Skyworth/Coocaa TV
65 lines (64 loc) • 2.4 kB
JavaScript
import { computed, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, createCommentVNode, createTextVNode, toDisplayString } from "vue";
import _sfc_main$1 from "./index5.mjs";
import "./index33.mjs";
import _export_sfc from "./index34.mjs";
const _sfc_main = {
__name: "button",
props: {
type: String,
size: String,
//small,default,large
text: String,
lefticon: String,
//icon在左侧
righticon: String,
//icon在右侧
loading: Boolean
//是否为加载中状态
},
setup(__props) {
const props = __props;
const hasText = computed(() => props.text !== null && props.text !== void 0);
return (_ctx, _cache) => {
return hasText.value ? (openBlock(), createElementBlock("button", {
key: 0,
class: normalizeClass([[__props.size, "type-" + __props.type], "tv-button"])
}, [
createElementVNode("div", {
class: normalizeClass([__props.loading ? "loading" : "", "lefticon"])
}, [
__props.lefticon ? (openBlock(), createBlock(_sfc_main$1, {
key: 0,
type: __props.lefticon
}, null, 8, ["type"])) : createCommentVNode("", true)
], 2),
createTextVNode(" " + toDisplayString(__props.text) + " ", 1),
createElementVNode("div", {
class: normalizeClass([__props.loading ? "loading" : "", "righticon"])
}, [
__props.righticon ? (openBlock(), createBlock(_sfc_main$1, {
key: 0,
type: __props.righticon
}, null, 8, ["type"])) : createCommentVNode("", true)
], 2)
], 2)) : (openBlock(), createElementBlock("button", {
key: 1,
class: normalizeClass([[__props.size, "type-" + __props.type, "icon-" + __props.size], "tv-button"])
}, [
createElementVNode("div", {
class: normalizeClass(__props.loading ? "loading" : ""),
style: { "display": "inline-block" }
}, [
__props.lefticon != "" || __props.righticon != "" ? (openBlock(), createBlock(_sfc_main$1, {
key: 0,
type: __props.lefticon || __props.righticon
}, null, 8, ["type"])) : createCommentVNode("", true)
], 2)
], 2));
};
}
};
const TvButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-421740cb"]]);
export {
TvButton as default
};