UNPKG

tdesign-mobile-vue

Version:
115 lines (111 loc) 3.72 kB
/** * tdesign v1.7.0 * (c) 2024 TDesign Group * @license MIT */ import { defineComponent, createVNode, Fragment, createTextVNode } from 'vue'; import { Image } from '../image/index.js'; import FooterProps from './props.js'; import config from '../config.js'; import { usePrefixClass } from '../hooks/useClass.js'; import '../image/image.js'; import '@babel/runtime/helpers/slicedToArray'; import '@babel/runtime/helpers/defineProperty'; import '@vueuse/core'; import 'tdesign-icons-vue-next'; import '../loading/index.js'; import '../loading/loading.js'; import '../loading/icon/gradient.js'; import '../_common/js/loading/circle-adapter.js'; import '../_common/js/utils/set-style.js'; import '../_common/js/utils/helper.js'; import '@babel/runtime/helpers/toConsumableArray'; import '@babel/runtime/helpers/objectWithoutProperties'; import 'lodash/isString'; import 'lodash/isNull'; import 'lodash/isUndefined'; import 'lodash/isNumber'; import 'lodash/isArray'; import '../loading/icon/spinner.js'; import '../loading/props.js'; import '../hooks/tnode.js'; import 'lodash/isFunction'; import 'lodash/camelCase'; import 'lodash/kebabCase'; import '../hooks/render-tnode.js'; import 'lodash/isEmpty'; import 'lodash/isObject'; import '../shared/dom.js'; import '../loading/plugin.js'; import 'lodash/merge'; import '../config-provider/useConfig.js'; import 'lodash/cloneDeep'; import '../config-provider/context.js'; import 'lodash/mergeWith'; import '../_common/js/global-config/mobile/default-config.js'; import '../_common/js/global-config/mobile/locale/zh_CN.js'; import '../_chunks/dep-d5364bc4.js'; import '@babel/runtime/helpers/typeof'; import '../_chunks/dep-eb734424.js'; import 'dayjs'; import '../shared/component.js'; import '../image/props.js'; var prefix = config.prefix; var _Footer = defineComponent({ name: "".concat(prefix, "-footer"), props: FooterProps, setup: function setup(props) { var footerClass = usePrefixClass("footer"); var footerLinkClass = usePrefixClass("footer__link"); var renderLogo = function renderLogo() { var logo = props.logo; if (!logo) { return; } return createVNode("a", { "class": "".concat(footerClass.value, "__logo"), "href": logo.url, "target": logo.target }, [logo.icon && createVNode(Image, { "class": "".concat(footerClass.value, "__icon"), "src": logo.icon }, null), logo.title && createVNode("span", { "class": "".concat(footerClass.value, "__title") }, [logo.title])]); }; var renderText = function renderText() { if (props.logo) { return; } return createVNode("div", { "class": "".concat(footerClass.value, "__text") }, [props.text]); }; var renderLink = function renderLink() { var links = props.links, logo = props.logo; var linksLength = links.length - 1; if (logo || linksLength < 0) { return; } return createVNode("div", { "class": "".concat(footerLinkClass.value, "-list") }, [links.map(function (link, index) { return createVNode(Fragment, null, [createVNode("a", { "href": link.url, "target": link.target, "class": "".concat(footerLinkClass.value, "-item") }, [link.name]), linksLength !== index && createVNode("div", { "class": "".concat(footerLinkClass.value, "-line") }, [createTextVNode("|")])]); })]); }; return function () { return createVNode("div", { "class": footerClass.value }, [renderLogo(), renderLink(), renderText()]); }; } }); export { _Footer as default }; //# sourceMappingURL=footer.js.map