mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
2.0 KiB
JavaScript
2 lines
2.0 KiB
JavaScript
import{c as p,a as f}from"./use-translate.d2900b8c.js";import{m as _,t as k,w as F}from"./with-install.19a35764.js";import{C as b}from"./index.bbd81525.js";import{z as C,e as a,D as B,r as E,o as y,a as h,w as l,B as t,F as v}from"./vue-libs.b44bc779.js";import{T as s}from"./function-call.509e41a7.js";import"./use-route.82f2be69.js";import"./index.b70c9b40.js";import"./mount-component.f3744995.js";import"./use-expose.c942d5f8.js";import"./index.e6e790ed.js";import"./constant.80c6de18.js";import"./interceptor.f0c85874.js";import"./use-touch.04ca7093.js";import"./use-lazy-render.f712e85e.js";import"./on-popup-reopen.138c77eb.js";import"./index.d46e53a8.js";import"./index.4e4daaac.js";const[x,u,r]=p("contact-card"),A={tel:String,name:String,type:_("add"),addText:String,editable:k},S=C({name:x,props:A,emits:["click"],setup(e,{emit:n}){const o=i=>{e.editable&&n("click",i)},d=()=>e.type==="add"?e.addText||r("addContact"):[a("div",null,[`${r("name")}\uFF1A${e.name}`]),a("div",null,[`${r("tel")}\uFF1A${e.tel}`])];return()=>a(b,{center:!0,icon:e.type==="edit"?"contact":"add-square",class:u([e.type]),border:!1,isLink:e.editable,valueClass:u("value"),onClick:o},{value:d})}}),g=F(S),m=g,Q=C({__name:"index",setup(e){const n=f({"zh-CN":{add:"\u65B0\u589E",edit:"\u7F16\u8F91",name:"\u5F20\u4E09",addContact:"\u6DFB\u52A0\u8054\u7CFB\u4EBA",editContact:"\u7F16\u8F91\u8054\u7CFB\u4EBA"},"en-US":{add:"Add",edit:"Edit",name:"John Snow",addContact:"Add Contact",editContact:"Edit Contact"}}),o=B(()=>({name:n("name"),tel:"13000000000"})),d=()=>s(n("add")),i=()=>s(n("edit"));return(w,T)=>{const c=E("demo-block");return y(),h(v,null,[a(c,{title:t(n)("addContact")},{default:l(()=>[a(t(m),{type:"add",onClick:d})]),_:1},8,["title"]),a(c,{title:t(n)("editContact")},{default:l(()=>[a(t(m),{type:"edit",name:t(o).name,tel:t(o).tel,onClick:i},null,8,["name","tel"])]),_:1},8,["title"]),a(c,{title:t(n)("uneditable")},{default:l(()=>[a(t(m),{type:"edit",name:t(o).name,tel:t(o).tel,editable:!1},null,8,["name","tel"])]),_:1},8,["title"])],64)}}});export{Q as default};
|