banner-Bjm1R_JU.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { defineComponent, ref, useSSRContext } from "vue";
  2. import { ssrRenderStyle, ssrRenderAttr } from "vue/server-renderer";
  3. import { useStore } from "vuex";
  4. const poster = "/assets/poster-CWZ8V__r.jpg";
  5. const _sfc_main = /* @__PURE__ */ defineComponent({
  6. __name: "banner",
  7. __ssrInlineRender: true,
  8. setup(__props) {
  9. var _a, _b;
  10. const store = useStore();
  11. const modelType = ref(1);
  12. const columnImage = ref("");
  13. const posterImg = ref(poster);
  14. modelType.value = (_a = store.state.menuList[store.state.sub]) == null ? void 0 : _a.modelType;
  15. columnImage.value = (_b = store.state.menuList[store.state.sub]) == null ? void 0 : _b.imagePath;
  16. return (_ctx, _push, _parent, _attrs) => {
  17. _push(`<!--[-->`);
  18. if (modelType.value == 1) {
  19. _push(`<div style="${ssrRenderStyle([{ "width": "100%", "height": "100%", "background-size": "cover", "background-position": "center center", "background-repeat": "no-repeat" }, { backgroundImage: `url(${columnImage.value})` }])}"></div>`);
  20. } else {
  21. _push(`<!---->`);
  22. }
  23. if (modelType.value == 2) {
  24. _push(`<video webkit-playsinline="webkit-playsinline" playsinline id="videoPlay" autoplay loop muted preload="auto"${ssrRenderAttr("poster", posterImg.value)} style="${ssrRenderStyle({ "width": "100%", "height": "100%", "object-fit": "fill" })}"${ssrRenderAttr("src", columnImage.value)}><source type="video/mp4"></video>`);
  25. } else {
  26. _push(`<!---->`);
  27. }
  28. _push(`<!--]-->`);
  29. };
  30. }
  31. });
  32. const _sfc_setup = _sfc_main.setup;
  33. _sfc_main.setup = (props, ctx) => {
  34. const ssrContext = useSSRContext();
  35. (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/layout/banner.vue");
  36. return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
  37. };
  38. export {
  39. _sfc_main as _
  40. };