Skip to content

status-bar

NPM version

Platform Support

Platform Support

intro:

Status bar plugin

Reference

Method

  • setState

    set state

ts
import { 
statusBarPlugin
} from "@plaoc/plugins";
statusBarPlugin
.
setState
({
color
: "#ff00ff" });
  • getState

    get current state

ts
import { 
statusBarPlugin
} from "@plaoc/plugins";
statusBarPlugin
.
getState
();
  • setColor

    set color

ts
import { 
statusBarPlugin
} from "@plaoc/plugins";
statusBarPlugin
.
setColor
("#ff00ff");
  • getColor

    get current color

ts
import { 
statusBarPlugin
} from "@plaoc/plugins";
statusBarPlugin
.
getColor
();
  • setStyle

    set style, such as dark mode

ts
import { 
statusBarPlugin
,
STATUS_BAR_STYLE
} from "@plaoc/plugins";
statusBarPlugin
.
setStyle
(
STATUS_BAR_STYLE
.
Dark
);
  • getStyle

    get current style

ts
import { 
statusBarPlugin
} from "@plaoc/plugins";
statusBarPlugin
.
getStyle
();
  • setOverlay

    set overlay

ts
import { 
statusBarPlugin
} from "@plaoc/plugins";
statusBarPlugin
.
setOverlay
(true);
  • getOverlay

    get current overlay

ts
import { 
statusBarPlugin
} from "@plaoc/plugins";
statusBarPlugin
.
getOverlay
();

Parameter

  • STATUS_BAR_STYLE

    status bar style

ts
import { 
STATUS_BAR_STYLE
} from "@plaoc/plugins";
STATUS_BAR_STYLE
.
Dark
;
  • $StatusBarWritableState

    status bar state

ts
import { 
STATUS_BAR_STYLE
, type
$StatusBarWritableState
} from "@plaoc/plugins";
const
state
:
Partial
<
$StatusBarWritableState
> = {
color
: "",
style
:
STATUS_BAR_STYLE
.
Light
,
overlay
: true,
visible
: true,
};

Usage Plugins

vue
<script setup lang="ts">
import { 
ref
} from "vue";
import {
statusBarPlugin
} from "@plaoc/plugins";
async function
getState
() {
const
state
=
statusBarPlugin
.
getState
();
} </script>

Usage WebComponent

vue
<script setup lang="ts">
import { 
ref
} from "vue";
import {
HTMLDwebStatusBarElement
} from "@plaoc/plugins";
const
$statusBarPlugin
=
ref
<
HTMLDwebStatusBarElement
>();
async function
getState
() {
const
statusBar
=
$statusBarPlugin
.
value
!;
const
state
=
statusBar
.
getState
();
} </script> <template> <
dweb-status-bar
ref
="
$statusBarPlugin
"></
dweb-status-bar
>
</template>

Released under the MIT License.