Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import a Vue plugin named 'MyPlugin'.
Vue
import [1] from 'my-plugin';
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a generic name like 'plugin' instead of the actual plugin name.
Forgetting to import the plugin before using it.
✗ Incorrect
You import the plugin by its exported name, here 'MyPlugin'.
2fill in blank
mediumComplete the code to install 'MyPlugin' in a Vue app instance named 'app'.
Vue
app.[1](MyPlugin); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'install' which is not a method on the app instance.
Using made-up method names like 'usePlugin'.
✗ Incorrect
Vue apps use the use method to install plugins.
3fill in blank
hardFix the error in the code to correctly create a Vue app and install 'MyPlugin'.
Vue
import { createApp } from 'vue'; import MyPlugin from 'my-plugin'; const app = createApp({}); app.[1](MyPlugin); app.mount('#app');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'install' which is not a method on the app instance.
Trying to call a non-existent method like 'add' or 'plugin'.
✗ Incorrect
The correct method to install a plugin on the app instance is use.
4fill in blank
hardFill both blanks to create a Vue app, install 'MyPlugin', and mount it to '#app'.
Vue
import { [1] } from 'vue'; import MyPlugin from 'my-plugin'; const app = [2]({}); app.use(MyPlugin); app.mount('#app');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect function names like 'create' or 'newApp'.
Confusing the import name with the app variable name.
✗ Incorrect
You import and call createApp to make a Vue app instance.
5fill in blank
hardFill all three blanks to import, create, and install 'MyPlugin' in a Vue app.
Vue
import { [1] } from 'vue'; import [2] from 'my-plugin'; const app = [3]({}); app.use(MyPlugin); app.mount('#app');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up import names or using wrong function names.
Forgetting to import the plugin before using it.
✗ Incorrect
Import createApp from Vue, import MyPlugin, then create the app with createApp.