vue.js - ionic vue 相册应用程序中的 `defineCustomElements(window);` 在哪里?

标签 vue.js ionic-framework

我已经开始学习ionic vue。我在关注这个 link .但我被困在这里 接下来,通过编辑 src/main.ts 导入 @ionic/pwa-elements。

// Above the createApp() line
import { defineCustomElements } from '@ionic/pwa-elements/loader';

// Call the element loader after the platform has been bootstrapped
defineCustomElements(window);
我的问题是我在哪里放置以下行?
// Call the element loader after the platform has been bootstrapped
defineCustomElements(window);
我试过了,但 id 不起作用
router.isReady().then(() => {
  app.mount('#app');
  defineCustomElements(window);
});

最佳答案

就像进口线,在 createApp() 行上方

import { defineCustomElements } from '@ionic/pwa-elements/loader';
defineCustomElements(window);

const app = createApp(App)
  .use(IonicVue)
  .use(router);

关于vue.js - ionic vue 相册应用程序中的 `defineCustomElements(window);` 在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64695854/

相关文章:

javascript - Laravel AJAX 请求到路由 api Vue 错误

javascript - v-for 中的 VueJS 事件绑定(bind)

php - 登录可以从数据库获取任何数据但显示结果 "Unregister Account"

javascript - 检查 Axios Promise catch block VueJs 中的 HTTP 状态代码

laravel - 如何将laravel vue站点部署到共享主机

ajax - Vue.js 资源 : http request with api key (Asana)

angular - <ngx-qrcode> 不是 ionic 4 中的已知元素

angularjs - 从 firebase 中删除项目

ionic-framework - 使用 VS Tools for Apache Cordova 执行 010_add_platform_class.js 时出错

ios - "ionic cordova platform add ios"无法获取平台 cordova-ios@0.0.1