UNPKG

cione-comp-lib

Version:

`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`

2 lines (1 loc) 3.62 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e=require("vue"),t=require("./img/success.js"),o=require("./img/info.js"),r=require("./img/warning.js"),n=require("./img/error.js");require("./index.vue_vue_type_style_index_0_scoped_true_lang.js");var l=require("../../_virtual/plugin-vue_export-helper.js");const p=e.defineComponent({name:"CoPromptBoxStd",props:{width:{type:String},height:{type:String},text:{type:String},textSize:{type:Number},isIcon:{type:Boolean},iconSrc:{type:String,default:"/data/images/compImages/success.png"},iconWidth:{type:Number},iconHeight:{type:Number},align:{type:String,default:"flex-start"},promptType:{type:String,default:"success"},show:{type:Boolean}},setup(t){const o=e.ref(),r=e.ref(),n=e.ref(),l=e.ref(),p=e.ref(t.text),i=e.ref(t.promptType),a=e.ref(t.show),s=()=>{e.nextTick((()=>{l.value=n.value.offsetHeight}))};return e.watch((()=>t.text),(()=>{p.value=t.text,s()})),e.watch((()=>t.textSize),(()=>{s()})),e.watch((()=>t.promptType),(()=>{i.value=t.promptType})),e.watch((()=>t.show),(()=>{a.value=t.show})),e.onMounted((()=>{r.value=o.value.parentNode.parentNode.parentNode})),{promptDom:o,promptTextDom:n,isShow:a,promptText:p,promptBoxType:i,getPromptType:["success","info","warning","error"],closeFn:()=>{a.value=!1},updataContent:(e,t)=>{e&&(p.value=e),t&&(i.value=t),s()},...e.toRefs(t)}}}),i=[(t=>(e.pushScopeId("data-v-53b885cd"),t=t(),e.popScopeId(),t))((()=>e.createElementVNode("svg",{viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{d:"M550.848 502.496l308.64-308.896a31.968 31.968 0 1 0-45.248-45.248l-308.608 308.896-308.64-308.928a31.968 31.968 0 1 0-45.248 45.248l308.64 308.896-308.64 308.896a31.968 31.968 0 1 0 45.248 45.248l308.64-308.896 308.608 308.896a31.968 31.968 0 1 0 45.248-45.248l-308.64-308.864z",fill:"#8a8a8a"})],-1)))];var a=l.default(p,[["render",function(l,p,a,s,c,m){return l.isShow?(e.openBlock(),e.createElementBlock("div",{key:0,class:"co-prompt-box-std",style:e.normalizeStyle({width:l.width||"100%",height:"100%"}),ref:"promptDom"},[e.createElementVNode("div",{class:e.normalizeClass(`prompt-box-std__box ${l.promptBoxType}-color`),style:e.normalizeStyle({borderRadius:"8px",justifyContent:"space-between"})},[e.createElementVNode("p",{class:"prompt-box-std__text",style:e.normalizeStyle({fontSize:`${l.textSize}px`,justifyContent:l.align}),ref:"promptTextDom"},["success"===l.promptBoxType&&l.isIcon?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.default,style:e.normalizeStyle({width:`${l.iconWidth}px`,height:`${l.iconHeight}px`})},null,4)):e.createCommentVNode("",!0),"info"===l.promptBoxType&&l.isIcon?(e.openBlock(),e.createElementBlock("img",{key:1,src:o.default,style:e.normalizeStyle({width:`${l.iconWidth}px`,height:`${l.iconHeight}px`})},null,4)):e.createCommentVNode("",!0),"warning"===l.promptBoxType&&l.isIcon?(e.openBlock(),e.createElementBlock("img",{key:2,src:r.default,style:e.normalizeStyle({width:`${l.iconWidth}px`,height:`${l.iconHeight}px`})},null,4)):e.createCommentVNode("",!0),"error"===l.promptBoxType&&l.isIcon?(e.openBlock(),e.createElementBlock("img",{key:3,src:n.default,style:e.normalizeStyle({width:`${l.iconWidth}px`,height:`${l.iconHeight}px`})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(l.promptText),1)],4),e.createElementVNode("span",{class:"prompt-box-std__icon",style:e.normalizeStyle({color:"rgba(168, 171, 178,1)"}),onClick:p[0]||(p[0]=(...e)=>l.closeFn&&l.closeFn(...e))},i,4)],6)],4)):e.createCommentVNode("",!0)}],["__scopeId","data-v-53b885cd"]]);exports.default=a;