wip: refactor(client): migrate components to composition api
This commit is contained in:
parent
bf51450647
commit
ed5c918d70
3 changed files with 86 additions and 123 deletions
|
|
@ -36,7 +36,8 @@ const active = $computed(() => {
|
|||
});
|
||||
|
||||
function onContextmenu(ev) {
|
||||
if (window.getSelection().toString() !== '') return;
|
||||
const selection = window.getSelection();
|
||||
if (selection && selection.toString() !== '') return;
|
||||
os.contextMenu([{
|
||||
type: 'label',
|
||||
text: props.to,
|
||||
|
|
@ -73,7 +74,7 @@ function onContextmenu(ev) {
|
|||
}], ev);
|
||||
}
|
||||
|
||||
function window() {
|
||||
function openWindow() {
|
||||
os.pageWindow(props.to);
|
||||
}
|
||||
|
||||
|
|
@ -93,7 +94,7 @@ function nav() {
|
|||
|
||||
if (props.behavior) {
|
||||
if (props.behavior === 'window') {
|
||||
return window();
|
||||
return openWindow();
|
||||
} else if (props.behavior === 'modalWindow') {
|
||||
return modalWindow();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue