farris-vue/packages/ui-vue/docs/.vitepress/dist/assets/components_notify_index.md....

54 lines
10 KiB
JavaScript

import{V as p,_,c as b,a as y,w as h,b as t,d as s,e as C,r as g,o as v}from"./app.14867dbe.js";const E={name:"component-doc",components:{"render-demo-0":function(){const{createElementVNode:c,openBlock:l,createElementBlock:r}=p;function u(o,a){return l(),r("div",null,[c("button",{class:"btn btn-primary",onClick:a[0]||(a[0]=(...e)=>o.showMessage&&o.showMessage(...e))},"show notify")])}const{defineComponent:i}=p,{ref:k,inject:n}=p;return{render:u,...i({setup(o,{expose:a}){a();const e=n("NotifyService");function f(){e.show({limit:5,showCloseButton:!1,position:"top-center",timeout:3e3,theme:"bootstrap",left:0,right:0,top:0,bottom:0,id:"1",animate:"fadeIn",options:{type:"string",title:"This is a title",msg:"This is some message"},toasts:[{type:"string",title:"This is a title",msg:"This is some message"}]})}const m={NotifyService:e,showMessage:f,ref:k,inject:n};return Object.defineProperty(m,"__isScriptSetup",{enumerable:!1,value:!0}),m}})}}()}},S=JSON.parse('{"title":"Notify \u901A\u77E5\u6D88\u606F","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u57FA\u672C\u7528\u6CD5","slug":"\u57FA\u672C\u7528\u6CD5"},{"level":2,"title":"\u5C5E\u6027","slug":"\u5C5E\u6027"},{"level":2,"title":"\u63D2\u69FD","slug":"\u63D2\u69FD"}],"relativePath":"components/notify/index.md"}'),D=t("h1",{id:"notify-\u901A\u77E5\u6D88\u606F",tabindex:"-1"},[s("Notify \u901A\u77E5\u6D88\u606F "),t("a",{class:"header-anchor",href:"#notify-\u901A\u77E5\u6D88\u606F","aria-hidden":"true"},"#")],-1),w=t("p",null,"Notify \u7EC4\u4EF6\u7528\u6765\u663E\u793A\u5168\u5C40\u6D88\u606F\u3002",-1),x=t("h2",{id:"\u57FA\u672C\u7528\u6CD5",tabindex:"-1"},[s("\u57FA\u672C\u7528\u6CD5 "),t("a",{class:"header-anchor",href:"#\u57FA\u672C\u7528\u6CD5","aria-hidden":"true"},"#")],-1),F=t("div",{class:"language-vue"},[t("pre",null,[t("code",null,[t("span",{class:"token tag"},[t("span",{class:"token tag"},[t("span",{class:"token punctuation"},"<"),s("script")]),s(),t("span",{class:"token attr-name"},"setup"),s(),t("span",{class:"token attr-name"},"lang"),t("span",{class:"token attr-value"},[t("span",{class:"token punctuation attr-equals"},"="),t("span",{class:"token punctuation"},'"'),s("ts"),t("span",{class:"token punctuation"},'"')]),t("span",{class:"token punctuation"},">")]),t("span",{class:"token script"},[t("span",{class:"token language-javascript"},[s(`
`),t("span",{class:"token keyword"},"import"),s(),t("span",{class:"token punctuation"},"{"),s(" ref"),t("span",{class:"token punctuation"},","),s(" inject "),t("span",{class:"token punctuation"},"}"),s(),t("span",{class:"token keyword"},"from"),s(),t("span",{class:"token string"},"'vue'"),t("span",{class:"token punctuation"},";"),s(`
`),t("span",{class:"token keyword"},"const"),s(" NotifyService "),t("span",{class:"token operator"},"="),s(),t("span",{class:"token function"},"inject"),t("span",{class:"token punctuation"},"("),t("span",{class:"token string"},"'NotifyService'"),t("span",{class:"token punctuation"},")"),t("span",{class:"token punctuation"},";"),s(`
`),t("span",{class:"token keyword"},"function"),s(),t("span",{class:"token function"},"showMessage"),t("span",{class:"token punctuation"},"("),t("span",{class:"token punctuation"},")"),s(),t("span",{class:"token punctuation"},"{"),s(`
NotifyService`),t("span",{class:"token punctuation"},"."),t("span",{class:"token function"},"show"),t("span",{class:"token punctuation"},"("),t("span",{class:"token punctuation"},"{"),s(`
`),t("span",{class:"token literal-property property"},"limit"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token number"},"5"),t("span",{class:"token punctuation"},","),s(`
`),t("span",{class:"token literal-property property"},"showCloseButton"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token boolean"},"false"),t("span",{class:"token punctuation"},","),s(`
`),t("span",{class:"token literal-property property"},"position"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token string"},"'top-center'"),t("span",{class:"token punctuation"},","),s(`
`),t("span",{class:"token literal-property property"},"timeout"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token number"},"3000"),t("span",{class:"token punctuation"},","),s(`
`),t("span",{class:"token literal-property property"},"theme"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token string"},"'bootstrap'"),t("span",{class:"token punctuation"},","),s(`
`),t("span",{class:"token literal-property property"},"left"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token number"},"0"),t("span",{class:"token punctuation"},","),s(`
`),t("span",{class:"token literal-property property"},"right"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token number"},"0"),t("span",{class:"token punctuation"},","),s(`
`),t("span",{class:"token literal-property property"},"top"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token number"},"0"),t("span",{class:"token punctuation"},","),s(`
`),t("span",{class:"token literal-property property"},"bottom"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token number"},"0"),t("span",{class:"token punctuation"},","),s(`
`),t("span",{class:"token literal-property property"},"id"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token string"},"'1'"),t("span",{class:"token punctuation"},","),s(`
`),t("span",{class:"token literal-property property"},"animate"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token string"},"'fadeIn'"),t("span",{class:"token punctuation"},","),s(`
`),t("span",{class:"token literal-property property"},"options"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token punctuation"},"{"),s(),t("span",{class:"token literal-property property"},"type"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token string"},"'string'"),t("span",{class:"token punctuation"},","),s(),t("span",{class:"token literal-property property"},"title"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token string"},"'This is a title'"),t("span",{class:"token punctuation"},","),s(),t("span",{class:"token literal-property property"},"msg"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token string"},"'This is some message'"),s(),t("span",{class:"token punctuation"},"}"),t("span",{class:"token punctuation"},","),s(`
`),t("span",{class:"token literal-property property"},"toasts"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token punctuation"},"["),t("span",{class:"token punctuation"},"{"),s(),t("span",{class:"token literal-property property"},"type"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token string"},"'string'"),t("span",{class:"token punctuation"},","),s(),t("span",{class:"token literal-property property"},"title"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token string"},"'This is a title'"),t("span",{class:"token punctuation"},","),s(),t("span",{class:"token literal-property property"},"msg"),t("span",{class:"token operator"},":"),s(),t("span",{class:"token string"},"'This is some message'"),s(),t("span",{class:"token punctuation"},"}"),t("span",{class:"token punctuation"},"]"),s(`
`),t("span",{class:"token punctuation"},"}"),t("span",{class:"token punctuation"},")"),t("span",{class:"token punctuation"},";"),s(`
`),t("span",{class:"token punctuation"},"}"),s(`
`)])]),t("span",{class:"token tag"},[t("span",{class:"token tag"},[t("span",{class:"token punctuation"},"</"),s("script")]),t("span",{class:"token punctuation"},">")]),s(`
`),t("span",{class:"token tag"},[t("span",{class:"token tag"},[t("span",{class:"token punctuation"},"<"),s("template")]),t("span",{class:"token punctuation"},">")]),s(`
`),t("span",{class:"token tag"},[t("span",{class:"token tag"},[t("span",{class:"token punctuation"},"<"),s("button")]),s(),t("span",{class:"token attr-name"},"class"),t("span",{class:"token attr-value"},[t("span",{class:"token punctuation attr-equals"},"="),t("span",{class:"token punctuation"},'"'),s("btn btn-primary"),t("span",{class:"token punctuation"},'"')]),s(),t("span",{class:"token attr-name"},"@click"),t("span",{class:"token attr-value"},[t("span",{class:"token punctuation attr-equals"},"="),t("span",{class:"token punctuation"},'"'),s("showMessage"),t("span",{class:"token punctuation"},'"')]),t("span",{class:"token punctuation"},">")]),s("show notify"),t("span",{class:"token tag"},[t("span",{class:"token tag"},[t("span",{class:"token punctuation"},"</"),s("button")]),t("span",{class:"token punctuation"},">")]),s(`
`),t("span",{class:"token tag"},[t("span",{class:"token tag"},[t("span",{class:"token punctuation"},"</"),s("template")]),t("span",{class:"token punctuation"},">")]),s(`
`)])])],-1),N=C('<h2 id="\u5C5E\u6027" tabindex="-1">\u5C5E\u6027 <a class="header-anchor" href="#\u5C5E\u6027" aria-hidden="true">#</a></h2><table><thead><tr><th style="text-align:left;">\u5C5E\u6027\u540D</th><th style="text-align:left;">\u7C7B\u578B</th><th style="text-align:left;">\u9ED8\u8BA4\u503C</th><th style="text-align:left;">\u8BF4\u660E</th></tr></thead><tbody><tr><td style="text-align:left;">id</td><td style="text-align:left;"><code>string</code></td><td style="text-align:left;">--</td><td style="text-align:left;">\u7EC4\u4EF6\u6807\u8BC6</td></tr></tbody></table><h2 id="\u63D2\u69FD" tabindex="-1">\u63D2\u69FD <a class="header-anchor" href="#\u63D2\u69FD" aria-hidden="true">#</a></h2><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>\u6682\u65E0\u5185\u5BB9</p></div>',4);function B(c,l,r,u,i,k){const n=g("render-demo-0"),d=g("demo");return v(),b("div",null,[D,w,x,y(d,{sourceCode:`<script setup lang="ts">
import { ref, inject } from 'vue';
const NotifyService = inject('NotifyService');
function showMessage() {
NotifyService.show({
limit: 5,
showCloseButton: false,
position: 'top-center',
timeout: 3000,
theme: 'bootstrap',
left: 0,
right: 0,
top: 0,
bottom: 0,
id: '1',
animate: 'fadeIn',
options: { type: 'string', title: 'This is a title', msg: 'This is some message' },
toasts: [{ type: 'string', title: 'This is a title', msg: 'This is some message' }]
});
}
<\/script>
<template>
<button class="btn btn-primary" @click="showMessage">show notify</button>
</template>
`},{highlight:h(()=>[F]),default:h(()=>[y(n)]),_:1}),N])}const A=_(E,[["render",B]]);export{S as __pageData,A as default};