question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vuejs integration

See original GitHub issue

Hi,

Experimenting with the vue cli and various setups to try and get UI5 webcomponents working. Few questions.

  • @ui5/webcomponents/dist/ does not seem to have an index file. Do all elements need to be imported individually?
  • import "@ui5/webcomponents/dist/DatePicker" generates a date picker (yay!), but also the following error in the console:

[Vue warn]: Unknown custom element: <ui5-datepicker> - did you register the component correctly? For recursive components, make sure to provide the “name” option.

Trying to register by trying to import DatePicker from ... and a subsequent Vue.use or Vue.component('ui5-datepicker', DatePicker) resulted in:

vue.runtime.esm.js?2b0e:5049 Uncaught TypeError: Class constructor DatePicker cannot be invoked without ‘new’

Less related but worth mentioning, when trying this in a TypeScript environment (otherwise same setup), the console also mentioned:

ToolsAPI.js:6 Uncaught TypeError: sap.ui.define is not a function at ToolsAPI.js:6

… which, indeed, was not present when expecting the window object.

Is there a basic setup you guys are using, or are these outstanding still in the current version?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
adrian-bobevcommented, Feb 16, 2019

Hi @jorgt,

we are preparing a Vue example with all the needed configurations. As soon as it is released, we will update the issue with a link to the app.

  • Yes, currently we do not have an index.js file that re exports all the components and you should import needed components one by one.

  • The warning that you got when import the DatePicker is normal. Vue has a configuration option to ignore all Custom Elements that are defined outside of it. The option is: Vue.config.ignoredElements

Vue.config.ignoredElements = [/^ui5-/];

For the TypeScript, could you please describe your setup?

0reactions
adrian-bobevcommented, Feb 27, 2019

@jorgt I will close the issue because cannot reproduce it. If you still have the issue with typescript, please explain your setup in more details.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ways of Using Vue - Vue.js
Client-side router; Blazing fast build tool chain; IDE support; Browser devtools; TypeScript integrations; Testing utilities.
Read more >
Integrations - Awesome Vue.js
Integrate Vue.js applications with services or other frameworks.
Read more >
Vue JS Integration - Documentation - Webix
Vue JS Integration ; you have a Vue-based app, where you want to place one or a few widgets (datatable, chart, spreadsheet, etc.)...
Read more >
Adding Vue.js to an Existing Project | by Blunt Jackson | Medium
For this first exercise we are going to create an app that provides an introduction that includes: display, data, and re-usable components. Let's...
Read more >
Vue.js integration | Worldpay Developers
Integrate the Access Checkout Web SDK in a Vue.js v2 application. Integration. You must add the SDK checkout.js script via JavaScript in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found