12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- "use strict";
- const common_vendor = require("../../../../common/vendor.js");
- if (!Math) {
- wdIcon();
- }
- const wdIcon = () => "../wd-icon/wd-icon.js";
- const __default__ = {
- name: "wd-video-preview",
- options: {
- addGlobalClass: true,
- virtualHost: true,
- styleIsolation: "shared"
- }
- };
- const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
- ...__default__,
- props: common_vendor.videoPreviewProps,
- setup(__props, { expose: __expose }) {
- const showPopup = common_vendor.ref(false);
- const previdewVideo = common_vendor.reactive({ url: "", poster: "", title: "" });
- function open(video) {
- showPopup.value = true;
- previdewVideo.url = video.url;
- previdewVideo.poster = video.poster;
- previdewVideo.title = video.title;
- }
- function close() {
- showPopup.value = false;
- common_vendor.nextTick$1(() => {
- handleClosed();
- });
- }
- function handleClosed() {
- previdewVideo.url = "";
- previdewVideo.poster = "";
- previdewVideo.title = "";
- }
- __expose({
- open,
- close
- });
- return (_ctx, _cache) => {
- return common_vendor.e({
- a: showPopup.value
- }, showPopup.value ? common_vendor.e({
- b: previdewVideo.url
- }, previdewVideo.url ? {
- c: previdewVideo.poster,
- d: previdewVideo.title,
- e: previdewVideo.url
- } : {}, {
- f: common_vendor.o(() => {
- }),
- g: common_vendor.o(close),
- h: common_vendor.p({
- name: "close",
- ["custom-class"]: `wd-video-preview__close`
- }),
- i: common_vendor.n(`wd-video-preview ${_ctx.customClass}`),
- j: common_vendor.s(_ctx.customStyle),
- k: common_vendor.o(close)
- }) : {});
- };
- }
- });
- const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-81c5af26"]]);
- wx.createComponent(Component);
|