You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suggestions are buttons meant to propose an action to the user. They are displayed in the top bar. For example, we can have a button that suggest installing vue-router if the package isn't detected in the app.
1148
+
1149
+
```js
1150
+
api.addSuggestion({
1151
+
id:'my-suggestion',
1152
+
type:'action', // Required (more types in the future)
1153
+
label:'Add vue-router',
1154
+
// This will be displayed in a details modal
1155
+
message:'A longer message for the modal',
1156
+
link:'http://link-to-docs-in-the-modal',
1157
+
// Function called when suggestion is activated by user
1158
+
asynchandler () {
1159
+
// ...
1160
+
return {
1161
+
// By default removes the button
1162
+
keep:false
1163
+
}
1164
+
}
1165
+
})
1166
+
```
1167
+
1168
+
Then you can remove the suggestion:
1169
+
1170
+
```js
1171
+
api.removeSuggestion('my-suggestion')
1172
+
```
1173
+
1174
+
Typically, you will use hooks to display the suggestion in the right context:
0 commit comments