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

vue 3 support (without changed /dist) #207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
morr wants to merge 1 commit into shakee93:master
base: master
Choose a base branch
Loading
from morr:vue-3
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/index.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const Toasted = {
}

const Toast = new T(options);
Vue.component('toasted', ToastComponent);
Vue.toasted = Vue.prototype.$toasted = Toast;
app.component('toasted', ToastComponent);
app.config.globalProperties.$toasted = Toast;
Comment on lines +11 to +12
Copy link

@adrianjost adrianjost Feb 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is app coming from? I doubt that it is a global variable.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L5: fix argument Vue -> app

adrianjost and sir-geronimo reacted with thumbs up emoji
Copy link

@sir-geronimo sir-geronimo Dec 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@morr You need to rename Vue to app on the install function or revert to the previous name.

Suggested change
app.component('toasted', ToastComponent);
app.config.globalProperties.$toasted = Toast;
Vue.component('toasted', ToastComponent);
Vue.config.globalProperties.$toasted = Toast;

}
};

Expand Down
11 changes: 3 additions & 8 deletions types/index.d.ts
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Vue, VueConstructor } from 'vue/types/vue'
import { PluginFunction } from "vue"
import { App, PluginFunction } from 'vue';

export interface ToastObject {
// html element of the toast
Expand Down Expand Up @@ -158,12 +157,8 @@ declare class ToastedPlugin {
static install: PluginFunction<ToastOptions>
}

declare module 'vue/types/vue' {
interface VueConstructor {
toasted: Toasted
}

interface Vue {
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$toasted: Toasted
}
}
Expand Down

AltStyle によって変換されたページ (->オリジナル) /