UNPKG

@fmdevui/fm-dev

Version:

Page level components developed based on Element Plus.

85 lines (82 loc) 2.72 kB
import { defineComponent, reactive, watch, resolveComponent, createElementBlock, openBlock, createElementVNode, createVNode, toDisplayString, withCtx } from 'vue'; import { useRoute } from 'vue-router'; import '../../utils/index.mjs'; import { verifyUrl } from '../../utils/comm/toolsValidate.mjs'; const _hoisted_1 = { class: "layout-padding layout-link-container" }; const _hoisted_2 = { class: "layout-padding-auto layout-padding-view" }; const _hoisted_3 = { class: "layout-link-warp" }; const _hoisted_4 = { class: "layout-link-msg" }; var _sfc_main = /* @__PURE__ */ defineComponent({ __name: "link", setup(__props) { const route = useRoute(); const state = reactive({ title: "", isLink: "" }); const onGotoFullPage = () => { const { origin, pathname } = window.location; if (verifyUrl(state.isLink)) window.open(state.isLink); else window.open(`${origin}${pathname}#${state.isLink}`); }; watch( () => route.path, () => { state.title = route.meta.title; state.isLink = route.meta.isLink; }, { immediate: true } ); return (_ctx, _cache) => { const _component_el_button = resolveComponent("el-button"); return openBlock(), createElementBlock("div", _hoisted_1, [ createElementVNode("div", _hoisted_2, [ createElementVNode("div", _hoisted_3, [ _cache[1] || (_cache[1] = createElementVNode( "i", { class: "layout-link-icon iconfont icon-xingqiu" }, null, -1 /* CACHED */ )), createElementVNode( "div", _hoisted_4, '\u9875\u9762 "' + toDisplayString(_ctx.$t(state.title)) + '" \u5DF2\u5728\u65B0\u7A97\u53E3\u4E2D\u6253\u5F00', 1 /* TEXT */ ), createVNode(_component_el_button, { class: "mt30", round: "", size: "default", onClick: onGotoFullPage }, { default: withCtx(() => _cache[0] || (_cache[0] = [ createElementVNode( "i", { class: "iconfont icon-lianjie" }, null, -1 /* CACHED */ ), createElementVNode( "span", null, "\u7ACB\u5373\u524D\u5F80\u4F53\u9A8C", -1 /* CACHED */ ) ])), _: 1, __: [0] }) ]) ]) ]); }; } }); export { _sfc_main as default };