Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 31, 2024. It is now read-only.

This Vue 3 plugin allows you to create computed properties that are computed asynchronously.

NotificationsYou must be signed in to change notification settings

mainclass/vue3-async-computed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This Vue 3 plugin allows you to create computed properties that are computed asynchronously.

import*asVuefrom'vue';import*asAsyncComputedfrom'vue3-async-computed';constasyncComputed=AsyncComputed.createPlugin({ref:Vue.ref});Vue.createApp({data(){return{userID:1,}},}).use(asyncComputed,{asyncprofile(result){result.value=`loading profile for user${this.userID}...`;constresponse=awaitfetch(`https://httpbin.org/get?userID=${this.userID}`);constdata=awaitresponse.json();result.value=data;},}).mount('#app');

And then, in HTML:

<div>{{ userID }}: {{ profile }}</div>

Install

Install usingnpm install vue3-async-computed

Examples

  • Basic example, the app displays price information for any selected crypto currency:JSFiddle

Todo

Describe how to approach manual re-calculation of the async computed properties. Provide an example.

About

This Vue 3 plugin allows you to create computed properties that are computed asynchronously.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp