5b64cad09c
修复table 布局问题 column 新增minWidth和ellipsisTooltip属性 ISSUES CLOSED: https://gitee.com/layui/layui-vue/issues/I58DWF
25 lines
5.2 KiB
JavaScript
25 lines
5.2 KiB
JavaScript
import{r as a,o as u,h as k,e as s,d as e,g as t,f as n}from"./vendor.e7911ee1.js";const i={class:"markdown-body"},r=t("\u4F7F \u7528 useClickOutside \u76D1 \u542C \u5143 \u7D20 \u5916 click \u4E8B \u4EF6"),d=n("div",{class:"language-vue"},[n("pre",null,[n("code",{"v-pre":""},[n("span",{class:"token tag"},[n("span",{class:"token tag"},[n("span",{class:"token punctuation"},"<"),t("template")]),n("span",{class:"token punctuation"},">")]),t(`
|
|
`),n("span",{class:"token tag"},[n("span",{class:"token tag"},[n("span",{class:"token punctuation"},"<"),t("lay-button")]),t(),n("span",{class:"token attr-name"},"type"),n("span",{class:"token attr-value"},[n("span",{class:"token punctuation attr-equals"},"="),n("span",{class:"token punctuation"},'"'),t("primary"),n("span",{class:"token punctuation"},'"')]),t(),n("span",{class:"token attr-name"},"ref"),n("span",{class:"token attr-value"},[n("span",{class:"token punctuation attr-equals"},"="),n("span",{class:"token punctuation"},'"'),t("buttonRef"),n("span",{class:"token punctuation"},'"')]),n("span",{class:"token punctuation"},">")]),t("\u5F53\u524D\u5143\u7D20"),n("span",{class:"token tag"},[n("span",{class:"token tag"},[n("span",{class:"token punctuation"},"</"),t("lay-button")]),n("span",{class:"token punctuation"},">")]),t(`
|
|
`),n("span",{class:"token tag"},[n("span",{class:"token tag"},[n("span",{class:"token punctuation"},"</"),t("template")]),n("span",{class:"token punctuation"},">")]),t(`
|
|
|
|
`),n("span",{class:"token tag"},[n("span",{class:"token tag"},[n("span",{class:"token punctuation"},"<"),t("script")]),n("span",{class:"token punctuation"},">")]),n("span",{class:"token script"},[n("span",{class:"token language-javascript"},[t(`
|
|
`),n("span",{class:"token keyword"},"import"),t(),n("span",{class:"token punctuation"},"{"),t(" ref"),n("span",{class:"token punctuation"},","),t(" watch "),n("span",{class:"token punctuation"},"}"),t(),n("span",{class:"token keyword"},"from"),t(),n("span",{class:"token string"},"'vue'"),t(`
|
|
`),n("span",{class:"token keyword"},"import"),t(),n("span",{class:"token punctuation"},"{"),t(" useClickOutside "),n("span",{class:"token punctuation"},"}"),t(),n("span",{class:"token keyword"},"from"),t(),n("span",{class:"token string"},"'@layui/hooks-vue'"),t(`
|
|
|
|
`),n("span",{class:"token keyword"},"export"),t(),n("span",{class:"token keyword"},"default"),t(),n("span",{class:"token punctuation"},"{"),t(`
|
|
`),n("span",{class:"token function"},"setup"),n("span",{class:"token punctuation"},"("),n("span",{class:"token punctuation"},")"),t(),n("span",{class:"token punctuation"},"{"),t(`
|
|
`),n("span",{class:"token keyword"},"const"),t(" buttonRef "),n("span",{class:"token operator"},"="),t(),n("span",{class:"token punctuation"},"("),t("ref "),n("span",{class:"token operator"},"<"),t(),n("span",{class:"token keyword"},"null"),n("span",{class:"token punctuation"},")"),t(),n("span",{class:"token operator"},"|"),t(),n("span",{class:"token punctuation"},"("),t("HTMLElement "),n("span",{class:"token operator"},">"),t(),n("span",{class:"token keyword"},"null"),n("span",{class:"token punctuation"},")"),t(`
|
|
`),n("span",{class:"token keyword"},"const"),t(" isClickOutside "),n("span",{class:"token operator"},"="),t(),n("span",{class:"token function"},"useClickOutside"),n("span",{class:"token punctuation"},"("),t("buttonRef"),n("span",{class:"token punctuation"},")"),t(`
|
|
|
|
`),n("span",{class:"token function"},"watch"),n("span",{class:"token punctuation"},"("),t("isClickOutside"),n("span",{class:"token punctuation"},","),t(),n("span",{class:"token punctuation"},"("),n("span",{class:"token punctuation"},")"),t(),n("span",{class:"token operator"},"=>"),t(),n("span",{class:"token punctuation"},"{"),t(`
|
|
console`),n("span",{class:"token punctuation"},"."),n("span",{class:"token function"},"log"),n("span",{class:"token punctuation"},"("),n("span",{class:"token string"},"'\u5143\u7D20\u5916 click \u4E8B\u4EF6'"),n("span",{class:"token punctuation"},")"),t(`
|
|
`),n("span",{class:"token punctuation"},"}"),n("span",{class:"token punctuation"},")"),t(`
|
|
|
|
`),n("span",{class:"token keyword"},"return"),t(),n("span",{class:"token punctuation"},"{"),t(`
|
|
buttonRef`),n("span",{class:"token punctuation"},","),t(`
|
|
`),n("span",{class:"token punctuation"},"}"),t(`
|
|
`),n("span",{class:"token punctuation"},"}"),n("span",{class:"token punctuation"},","),t(`
|
|
`),n("span",{class:"token punctuation"},"}"),t(`
|
|
`)])]),n("span",{class:"token tag"},[n("span",{class:"token tag"},[n("span",{class:"token punctuation"},"</"),t("script")]),n("span",{class:"token punctuation"},">")]),t(`
|
|
`)])])],-1),m=n("table",null,[n("thead",null,[n("tr",null,[n("th",null,"\u5907\u6CE8"),n("th",null,"\u63CF\u8FF0"),n("th",null,"\u7C7B\u578B")])]),n("tbody",null,[n("tr",null,[n("td",null,"isClickOutside"),n("td",null,"\u4F7F\u7528 watch \u76D1\u542C"),n("td",null,"Ref")])])],-1),w={setup(g,{expose:c}){return c({frontmatter:{}}),(f,_)=>{const o=a("lay-field"),p=a("lay-block"),l=a("lay-table-box");return u(),k("div",i,[s(o,{title:"\u57FA\u7840\u4F7F\u7528",style:{"margin-top":"20px","margin-bottom":"20px"}}),s(p,{style:{"margin-left":"8px","margin-bottom":"40px"}},{default:e(()=>[r]),_:1}),d,s(o,{title:"\u4F7F\u7528\u5907\u6CE8",style:{"margin-top":"20px","margin-bottom":"20px"}}),s(l,null,{default:e(()=>[m]),_:1})])}}};export{w as default};
|